Skip to content

Commit 5af5be7

Browse files
committed
Merge remote-tracking branch 'origin/main' into eii-dylib-default-override
2 parents 44e8bb8 + 7c3c88f commit 5af5be7

1,664 files changed

Lines changed: 40958 additions & 21136 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 299 additions & 61 deletions
Large diffs are not rendered by default.

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ pub enum CanonAbi {
3232
/// An ABI that rustc does not know how to call or define.
3333
Custom,
3434

35+
/// Swift calling convention, exposed via LLVM's `swiftcc`. Cross-platform
36+
/// and not tied to a specific target architecture.
37+
Swift,
38+
3539
/// ABIs relevant to 32-bit Arm targets
3640
Arm(ArmCall),
3741
/// ABI relevant to GPUs: the entry point for a GPU kernel
@@ -58,6 +62,7 @@ impl CanonAbi {
5862
CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::RustPreserveNone => true,
5963
CanonAbi::C
6064
| CanonAbi::Custom
65+
| CanonAbi::Swift
6166
| CanonAbi::Arm(_)
6267
| CanonAbi::GpuKernel
6368
| CanonAbi::Interrupt(_)
@@ -77,6 +82,7 @@ impl fmt::Display for CanonAbi {
7782
CanonAbi::RustCold => ExternAbi::RustCold,
7883
CanonAbi::RustPreserveNone => ExternAbi::RustPreserveNone,
7984
CanonAbi::Custom => ExternAbi::Custom,
85+
CanonAbi::Swift => ExternAbi::Swift,
8086
CanonAbi::Arm(arm_call) => match arm_call {
8187
ArmCall::Aapcs => ExternAbi::Aapcs { unwind: false },
8288
ArmCall::CCmseNonSecureCall => ExternAbi::CmseNonSecureCall,

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::fmt;
33
use std::hash::{Hash, Hasher};
44

55
#[cfg(feature = "nightly")]
6-
use rustc_data_structures::stable_hasher::{StableHash, StableHashCtxt, StableHasher, StableOrd};
6+
use rustc_data_structures::stable_hash::{StableHash, StableHashCtxt, StableHasher, StableOrd};
77
#[cfg(feature = "nightly")]
88
use rustc_macros::{Decodable, Encodable};
99
#[cfg(feature = "nightly")]
@@ -62,6 +62,10 @@ pub enum ExternAbi {
6262
/// and only valid on platforms that have a UEFI standard
6363
EfiApi,
6464

65+
/// Swift's calling convention, used to interoperate with Swift code without
66+
/// going through C as an intermediary.
67+
Swift,
68+
6569
/* arm */
6670
/// Arm Architecture Procedure Call Standard, sometimes `ExternAbi::C` is an alias for this
6771
Aapcs {
@@ -173,6 +177,7 @@ abi_impls! {
173177
C { unwind: false } =><= "C",
174178
C { unwind: true } =><= "C-unwind",
175179
Rust =><= "Rust",
180+
Swift =><= "Swift",
176181
Aapcs { unwind: false } =><= "aapcs",
177182
Aapcs { unwind: true } =><= "aapcs-unwind",
178183
AvrInterrupt =><= "avr-interrupt",
@@ -348,7 +353,8 @@ impl ExternAbi {
348353
| Self::Vectorcall { .. }
349354
| Self::SysV64 { .. }
350355
| Self::Win64 { .. }
351-
| Self::RustPreserveNone => true,
356+
| Self::RustPreserveNone
357+
| Self::Swift => true,
352358
}
353359
}
354360
}

compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use std::str::FromStr;
4545

4646
use bitflags::bitflags;
4747
#[cfg(feature = "nightly")]
48-
use rustc_data_structures::stable_hasher::StableOrd;
48+
use rustc_data_structures::stable_hash::StableOrd;
4949
#[cfg(feature = "nightly")]
5050
use rustc_error_messages::{DiagArgValue, IntoDiagArg};
5151
#[cfg(feature = "nightly")]

compiler/rustc_ast/src/ast.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub use GenericArgs::*;
2525
pub use UnsafeSource::*;
2626
pub use rustc_ast_ir::{FloatTy, IntTy, Movability, Mutability, Pinnedness, UintTy};
2727
use rustc_data_structures::packed::Pu128;
28-
use rustc_data_structures::stable_hasher::{StableHash, StableHashCtxt, StableHasher};
28+
use rustc_data_structures::stable_hash::{StableHash, StableHashCtxt, StableHasher};
2929
use rustc_data_structures::stack::ensure_sufficient_stack;
3030
use rustc_data_structures::tagged_ptr::Tag;
3131
use rustc_macros::{Decodable, Encodable, StableHash, Walkable};
@@ -1594,6 +1594,7 @@ impl Expr {
15941594
// need parens sometimes. E.g. we can print `(let _ = a) && b` as `let _ = a && b`
15951595
// but we need to print `(let _ = a) < b` as-is with parens.
15961596
| ExprKind::Let(..)
1597+
| ExprKind::Move(..)
15971598
| ExprKind::Unary(..) => ExprPrecedence::Prefix,
15981599

15991600
// Need parens if and only if there are prefix attributes.
@@ -1763,6 +1764,8 @@ pub enum ExprKind {
17631764
Binary(BinOp, Box<Expr>, Box<Expr>),
17641765
/// A unary operation (e.g., `!x`, `*x`).
17651766
Unary(UnOp, Box<Expr>),
1767+
/// A `move(expr)` expression.
1768+
Move(Box<Expr>, Span),
17661769
/// A literal (e.g., `1`, `"foo"`).
17671770
Lit(token::Lit),
17681771
/// A cast (e.g., `foo as f64`).

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ pub fn list_contains_name(items: &[MetaItemInner], name: Symbol) -> bool {
845845
}
846846

847847
impl MetaItemLit {
848-
pub fn value_str(&self) -> Option<Symbol> {
848+
pub fn value_as_str(&self) -> Option<Symbol> {
849849
LitKind::from_token_lit(self.as_token_lit()).ok().and_then(|lit| lit.str())
850850
}
851851
}

compiler/rustc_ast/src/node_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::fmt;
22

3-
use rustc_data_structures::stable_hasher::{StableHash, StableHashCtxt, StableHasher};
3+
use rustc_data_structures::stable_hash::{StableHash, StableHashCtxt, StableHasher};
44
use rustc_span::LocalExpnId;
55

66
rustc_index::newtype_index! {

compiler/rustc_ast/src/tokenstream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::ops::Range;
1010
use std::sync::Arc;
1111
use std::{cmp, fmt, iter, mem};
1212

13-
use rustc_data_structures::stable_hasher::{StableHash, StableHashCtxt, StableHasher};
13+
use rustc_data_structures::stable_hash::{StableHash, StableHashCtxt, StableHasher};
1414
use rustc_data_structures::sync;
1515
use rustc_macros::{Decodable, Encodable, StableHash, Walkable};
1616
use rustc_serialize::{Decodable, Encodable};

compiler/rustc_ast/src/util/classify.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ pub fn leading_labeled_expr(mut expr: &ast::Expr) -> bool {
108108
Assign(e, _, _)
109109
| AssignOp(_, e, _)
110110
| Await(e, _)
111+
| Move(e, _)
111112
| Use(e, _)
112113
| Binary(_, e, _)
113114
| Call(e, _)
@@ -183,6 +184,7 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<TrailingBrace<'_>> {
183184
| Ret(Some(e))
184185
| Unary(_, e)
185186
| Yeet(Some(e))
187+
| Move(e, _)
186188
| Become(e) => {
187189
expr = e;
188190
}

compiler/rustc_ast/src/visit.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,9 @@ macro_rules! common_visitor_and_walkers {
10241024
visit_visitable!($($mut)? vis, block, opt_label),
10251025
ExprKind::Gen(capt, body, kind, decl_span) =>
10261026
visit_visitable!($($mut)? vis, capt, body, kind, decl_span),
1027-
ExprKind::Await(expr, span) | ExprKind::Use(expr, span) =>
1027+
ExprKind::Await(expr, span)
1028+
| ExprKind::Move(expr, span)
1029+
| ExprKind::Use(expr, span) =>
10281030
visit_visitable!($($mut)? vis, expr, span),
10291031
ExprKind::Assign(lhs, rhs, span) =>
10301032
visit_visitable!($($mut)? vis, lhs, rhs, span),

0 commit comments

Comments
 (0)