Skip to content

Commit d98a9c6

Browse files
author
The Miri Cronjob Bot
committed
Merge ref '51ff895062ba' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 51ff895 Filtered ref: 5057370cda58bcaad24ea094ec11c8c01b24c2bc This merge was created using https://github.com/rust-lang/josh-sync.
2 parents ef1dab1 + 51ff895 commit d98a9c6

File tree

270 files changed

+2740
-2203
lines changed

Some content is hidden

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

270 files changed

+2740
-2203
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100"
158158

159159
[[package]]
160160
name = "ar_archive_writer"
161-
version = "0.4.2"
161+
version = "0.5.1"
162162
source = "registry+https://github.com/rust-lang/crates.io-index"
163-
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
163+
checksum = "7eb93bbb63b9c227414f6eb3a0adfddca591a8ce1e9b60661bb08969b87e340b"
164164
dependencies = [
165-
"object 0.36.7",
165+
"object 0.37.3",
166166
]
167167

168168
[[package]]

Cargo.toml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,33 +59,6 @@ exclude = [
5959
"obj",
6060
]
6161

62-
[workspace.dependencies]
63-
# tidy-alphabetical-start
64-
bitflags = "2.9.3"
65-
derive-where = "1.6.0"
66-
either = "1.15.0"
67-
indexmap = "2.10.0"
68-
itertools = "0.12.1"
69-
# FIXME: Remove this pin once this rustix issue is resolved
70-
# https://github.com/bytecodealliance/rustix/issues/1496
71-
libc = "=0.2.174"
72-
measureme = "12.0.3"
73-
memchr = "2.7.5"
74-
odht = { version = "0.3.1", features = ["nightly"] }
75-
polonius-engine = "0.13.0"
76-
proc-macro2 = "1.0.101"
77-
quote = "1.0.40"
78-
rustc-demangle = "0.1.26"
79-
rustc-hash = "2.1.1"
80-
rustc-literal-escaper = "0.0.5"
81-
rustc_apfloat = "0.2.3"
82-
scoped-tls = "1.0.1"
83-
serde_json = "1.0.142"
84-
tempfile = "3.20.0"
85-
thin-vec = "0.2.14"
86-
tracing = "0.1.37"
87-
# tidy-alphabetical-end
88-
8962
[profile.release.package.rustc_thread_pool]
9063
# The rustc fork of Rayon has deadlock detection code which intermittently
9164
# causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227)

compiler/rustc_abi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
bitflags.workspace = true
8+
bitflags = "2.4.1"
99
rand = { version = "0.9.0", default-features = false, optional = true }
1010
rand_xoshiro = { version = "0.7.0", optional = true }
1111
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
@@ -15,7 +15,7 @@ rustc_index = { path = "../rustc_index", default-features = false }
1515
rustc_macros = { path = "../rustc_macros", optional = true }
1616
rustc_serialize = { path = "../rustc_serialize", optional = true }
1717
rustc_span = { path = "../rustc_span", optional = true }
18-
tracing.workspace = true
18+
tracing = "0.1"
1919
# tidy-alphabetical-end
2020

2121
[features]

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use std::hash::{Hash, Hasher};
66
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd};
77
#[cfg(feature = "nightly")]
88
use rustc_macros::{Decodable, Encodable};
9+
#[cfg(feature = "nightly")]
10+
use rustc_span::Symbol;
911

1012
use crate::AbiFromStrErr;
1113

@@ -226,6 +228,13 @@ impl StableOrd for ExternAbi {
226228
#[cfg(feature = "nightly")]
227229
rustc_error_messages::into_diag_arg_using_display!(ExternAbi);
228230

231+
#[cfg(feature = "nightly")]
232+
pub enum CVariadicStatus {
233+
NotSupported,
234+
Stable,
235+
Unstable { feature: Symbol },
236+
}
237+
229238
impl ExternAbi {
230239
/// An ABI "like Rust"
231240
///
@@ -238,23 +247,33 @@ impl ExternAbi {
238247
matches!(self, Rust | RustCall | RustCold)
239248
}
240249

241-
pub fn supports_varargs(self) -> bool {
250+
/// Returns whether the ABI supports C variadics. This only controls whether we allow *imports*
251+
/// of such functions via `extern` blocks; there's a separate check during AST construction
252+
/// guarding *definitions* of variadic functions.
253+
#[cfg(feature = "nightly")]
254+
pub fn supports_c_variadic(self) -> CVariadicStatus {
242255
// * C and Cdecl obviously support varargs.
243256
// * C can be based on Aapcs, SysV64 or Win64, so they must support varargs.
244257
// * EfiApi is based on Win64 or C, so it also supports it.
258+
// * System automatically falls back to C when used with variadics, therefore supports it.
245259
//
246260
// * Stdcall does not, because it would be impossible for the callee to clean
247261
// up the arguments. (callee doesn't know how many arguments are there)
248262
// * Same for Fastcall, Vectorcall and Thiscall.
249263
// * Other calling conventions are related to hardware or the compiler itself.
264+
//
265+
// All of the supported ones must have a test in `tests/codegen/cffi/c-variadic-ffi.rs`.
250266
match self {
251267
Self::C { .. }
252268
| Self::Cdecl { .. }
253269
| Self::Aapcs { .. }
254270
| Self::Win64 { .. }
255271
| Self::SysV64 { .. }
256-
| Self::EfiApi => true,
257-
_ => false,
272+
| Self::EfiApi => CVariadicStatus::Stable,
273+
Self::System { .. } => {
274+
CVariadicStatus::Unstable { feature: rustc_span::sym::extern_system_varargs }
275+
}
276+
_ => CVariadicStatus::NotSupported,
258277
}
259278
}
260279
}

compiler/rustc_abi/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ mod tests;
6363

6464
pub use callconv::{Heterogeneous, HomogeneousAggregate, Reg, RegKind};
6565
pub use canon_abi::{ArmCall, CanonAbi, InterruptKind, X86Call};
66+
#[cfg(feature = "nightly")]
67+
pub use extern_abi::CVariadicStatus;
6668
pub use extern_abi::{ExternAbi, all_names};
6769
#[cfg(feature = "nightly")]
6870
pub use layout::{FIRST_VARIANT, FieldIdx, Layout, TyAbiInterface, TyAndLayout, VariantIdx};

compiler/rustc_ast/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
bitflags.workspace = true
9-
memchr.workspace = true
10-
rustc-literal-escaper.workspace = true
8+
bitflags = "2.4.1"
9+
memchr = "2.7.4"
10+
rustc-literal-escaper = "0.0.5"
1111
rustc_ast_ir = { path = "../rustc_ast_ir" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_index = { path = "../rustc_index" }
1414
rustc_macros = { path = "../rustc_macros" }
1515
rustc_serialize = { path = "../rustc_serialize" }
1616
rustc_span = { path = "../rustc_span" }
1717
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
18-
thin-vec.workspace = true
19-
tracing.workspace = true
18+
thin-vec = "0.2.12"
19+
tracing = "0.1"
2020
# tidy-alphabetical-end

compiler/rustc_ast/src/ast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ pub enum PatKind {
937937
#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Walkable)]
938938
pub enum PatFieldsRest {
939939
/// `module::StructName { field, ..}`
940-
Rest,
940+
Rest(Span),
941941
/// `module::StructName { field, syntax error }`
942942
Recovered(ErrorGuaranteed),
943943
/// `module::StructName { field }`
@@ -4051,8 +4051,8 @@ mod size_asserts {
40514051
static_assert_size!(Local, 96);
40524052
static_assert_size!(MetaItemLit, 40);
40534053
static_assert_size!(Param, 40);
4054-
static_assert_size!(Pat, 72);
4055-
static_assert_size!(PatKind, 48);
4054+
static_assert_size!(Pat, 80);
4055+
static_assert_size!(PatKind, 56);
40564056
static_assert_size!(Path, 24);
40574057
static_assert_size!(PathSegment, 24);
40584058
static_assert_size!(Stmt, 32);

compiler/rustc_ast_lowering/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ rustc_session = { path = "../rustc_session" }
2424
rustc_span = { path = "../rustc_span" }
2525
rustc_target = { path = "../rustc_target" }
2626
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
27-
thin-vec.workspace = true
28-
tracing.workspace = true
27+
thin-vec = "0.2.12"
28+
tracing = "0.1"
2929
# tidy-alphabetical-end

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,10 +1434,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
14341434
self.dcx().emit_err(FunctionalRecordUpdateDestructuringAssignment {
14351435
span: e.span,
14361436
});
1437-
true
1437+
Some(self.lower_span(e.span))
14381438
}
1439-
StructRest::Rest(_) => true,
1440-
StructRest::None => false,
1439+
StructRest::Rest(span) => Some(self.lower_span(*span)),
1440+
StructRest::None => None,
14411441
};
14421442
let struct_pat = hir::PatKind::Struct(qpath, field_pats, fields_omitted);
14431443
return self.pat_without_dbm(lhs.span, struct_pat);

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20282028

20292029
(
20302030
hir::ParamName::Plain(self.lower_ident(param.ident)),
2031-
hir::GenericParamKind::Const { ty, default, synthetic: false },
2031+
hir::GenericParamKind::Const { ty, default },
20322032
)
20332033
}
20342034
}
@@ -2508,7 +2508,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
25082508
fields: &'hir [hir::PatField<'hir>],
25092509
) -> &'hir hir::Pat<'hir> {
25102510
let qpath = hir::QPath::LangItem(lang_item, self.lower_span(span));
2511-
self.pat(span, hir::PatKind::Struct(qpath, fields, false))
2511+
self.pat(span, hir::PatKind::Struct(qpath, fields, None))
25122512
}
25132513

25142514
fn pat_ident(&mut self, span: Span, ident: Ident) -> (&'hir hir::Pat<'hir>, HirId) {

0 commit comments

Comments
 (0)