Skip to content

Commit 520e45a

Browse files
author
The Miri Cronjob Bot
committed
Merge ref '4ba1cf9ade4c' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 4ba1cf9 Filtered ref: 84b64d836ed478c54972a1d2639e60fa5f3ce26f Upstream diff: rust-lang/rust@2a9bacf...4ba1cf9 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents ae57f08 + 5446444 commit 520e45a

File tree

123 files changed

+2164
-1282
lines changed

Some content is hidden

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

123 files changed

+2164
-1282
lines changed

Cargo.lock

Lines changed: 66 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,12 @@ version = "1.0.10"
11911191
source = "registry+https://github.com/rust-lang/crates.io-index"
11921192
checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921"
11931193

1194+
[[package]]
1195+
name = "dyn-clone"
1196+
version = "1.0.19"
1197+
source = "registry+https://github.com/rust-lang/crates.io-index"
1198+
checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005"
1199+
11941200
[[package]]
11951201
name = "either"
11961202
version = "1.15.0"
@@ -2347,11 +2353,11 @@ dependencies = [
23472353

23482354
[[package]]
23492355
name = "miow"
2350-
version = "0.6.0"
2356+
version = "0.6.1"
23512357
source = "registry+https://github.com/rust-lang/crates.io-index"
2352-
checksum = "359f76430b20a79f9e20e115b3428614e654f04fab314482fc0fda0ebd3c6044"
2358+
checksum = "536bfad37a309d62069485248eeaba1e8d9853aaf951caaeaed0585a95346f08"
23532359
dependencies = [
2354-
"windows-sys 0.48.0",
2360+
"windows-sys 0.60.2",
23552361
]
23562362

23572363
[[package]]
@@ -3122,6 +3128,26 @@ dependencies = [
31223128
"thiserror 2.0.15",
31233129
]
31243130

3131+
[[package]]
3132+
name = "ref-cast"
3133+
version = "1.0.24"
3134+
source = "registry+https://github.com/rust-lang/crates.io-index"
3135+
checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf"
3136+
dependencies = [
3137+
"ref-cast-impl",
3138+
]
3139+
3140+
[[package]]
3141+
name = "ref-cast-impl"
3142+
version = "1.0.24"
3143+
source = "registry+https://github.com/rust-lang/crates.io-index"
3144+
checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7"
3145+
dependencies = [
3146+
"proc-macro2",
3147+
"quote",
3148+
"syn 2.0.106",
3149+
]
3150+
31253151
[[package]]
31263152
name = "regex"
31273153
version = "1.11.1"
@@ -4577,6 +4603,7 @@ dependencies = [
45774603
"rustc_macros",
45784604
"rustc_serialize",
45794605
"rustc_span",
4606+
"schemars",
45804607
"serde",
45814608
"serde_derive",
45824609
"serde_json",
@@ -4900,6 +4927,31 @@ dependencies = [
49004927
"windows-sys 0.59.0",
49014928
]
49024929

4930+
[[package]]
4931+
name = "schemars"
4932+
version = "1.0.4"
4933+
source = "registry+https://github.com/rust-lang/crates.io-index"
4934+
checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0"
4935+
dependencies = [
4936+
"dyn-clone",
4937+
"ref-cast",
4938+
"schemars_derive",
4939+
"serde",
4940+
"serde_json",
4941+
]
4942+
4943+
[[package]]
4944+
name = "schemars_derive"
4945+
version = "1.0.4"
4946+
source = "registry+https://github.com/rust-lang/crates.io-index"
4947+
checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80"
4948+
dependencies = [
4949+
"proc-macro2",
4950+
"quote",
4951+
"serde_derive_internals",
4952+
"syn 2.0.106",
4953+
]
4954+
49034955
[[package]]
49044956
name = "scoped-tls"
49054957
version = "1.0.1"
@@ -4974,6 +5026,17 @@ dependencies = [
49745026
"syn 2.0.106",
49755027
]
49765028

5029+
[[package]]
5030+
name = "serde_derive_internals"
5031+
version = "0.29.1"
5032+
source = "registry+https://github.com/rust-lang/crates.io-index"
5033+
checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
5034+
dependencies = [
5035+
"proc-macro2",
5036+
"quote",
5037+
"syn 2.0.106",
5038+
]
5039+
49775040
[[package]]
49785041
name = "serde_json"
49795042
version = "1.0.142"
@@ -6314,15 +6377,6 @@ dependencies = [
63146377
"windows-link",
63156378
]
63166379

6317-
[[package]]
6318-
name = "windows-sys"
6319-
version = "0.48.0"
6320-
source = "registry+https://github.com/rust-lang/crates.io-index"
6321-
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
6322-
dependencies = [
6323-
"windows-targets 0.48.5",
6324-
]
6325-
63266380
[[package]]
63276381
name = "windows-sys"
63286382
version = "0.52.0"
@@ -6350,21 +6404,6 @@ dependencies = [
63506404
"windows-targets 0.53.3",
63516405
]
63526406

6353-
[[package]]
6354-
name = "windows-targets"
6355-
version = "0.48.5"
6356-
source = "registry+https://github.com/rust-lang/crates.io-index"
6357-
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
6358-
dependencies = [
6359-
"windows_aarch64_gnullvm 0.48.5",
6360-
"windows_aarch64_msvc 0.48.5",
6361-
"windows_i686_gnu 0.48.5",
6362-
"windows_i686_msvc 0.48.5",
6363-
"windows_x86_64_gnu 0.48.5",
6364-
"windows_x86_64_gnullvm 0.48.5",
6365-
"windows_x86_64_msvc 0.48.5",
6366-
]
6367-
63686407
[[package]]
63696408
name = "windows-targets"
63706409
version = "0.52.6"
@@ -6407,12 +6446,6 @@ dependencies = [
64076446
"windows-link",
64086447
]
64096448

6410-
[[package]]
6411-
name = "windows_aarch64_gnullvm"
6412-
version = "0.48.5"
6413-
source = "registry+https://github.com/rust-lang/crates.io-index"
6414-
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
6415-
64166449
[[package]]
64176450
name = "windows_aarch64_gnullvm"
64186451
version = "0.52.6"
@@ -6425,12 +6458,6 @@ version = "0.53.0"
64256458
source = "registry+https://github.com/rust-lang/crates.io-index"
64266459
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
64276460

6428-
[[package]]
6429-
name = "windows_aarch64_msvc"
6430-
version = "0.48.5"
6431-
source = "registry+https://github.com/rust-lang/crates.io-index"
6432-
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
6433-
64346461
[[package]]
64356462
name = "windows_aarch64_msvc"
64366463
version = "0.52.6"
@@ -6443,12 +6470,6 @@ version = "0.53.0"
64436470
source = "registry+https://github.com/rust-lang/crates.io-index"
64446471
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
64456472

6446-
[[package]]
6447-
name = "windows_i686_gnu"
6448-
version = "0.48.5"
6449-
source = "registry+https://github.com/rust-lang/crates.io-index"
6450-
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
6451-
64526473
[[package]]
64536474
name = "windows_i686_gnu"
64546475
version = "0.52.6"
@@ -6473,12 +6494,6 @@ version = "0.53.0"
64736494
source = "registry+https://github.com/rust-lang/crates.io-index"
64746495
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
64756496

6476-
[[package]]
6477-
name = "windows_i686_msvc"
6478-
version = "0.48.5"
6479-
source = "registry+https://github.com/rust-lang/crates.io-index"
6480-
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
6481-
64826497
[[package]]
64836498
name = "windows_i686_msvc"
64846499
version = "0.52.6"
@@ -6491,12 +6506,6 @@ version = "0.53.0"
64916506
source = "registry+https://github.com/rust-lang/crates.io-index"
64926507
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
64936508

6494-
[[package]]
6495-
name = "windows_x86_64_gnu"
6496-
version = "0.48.5"
6497-
source = "registry+https://github.com/rust-lang/crates.io-index"
6498-
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
6499-
65006509
[[package]]
65016510
name = "windows_x86_64_gnu"
65026511
version = "0.52.6"
@@ -6509,12 +6518,6 @@ version = "0.53.0"
65096518
source = "registry+https://github.com/rust-lang/crates.io-index"
65106519
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
65116520

6512-
[[package]]
6513-
name = "windows_x86_64_gnullvm"
6514-
version = "0.48.5"
6515-
source = "registry+https://github.com/rust-lang/crates.io-index"
6516-
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
6517-
65186521
[[package]]
65196522
name = "windows_x86_64_gnullvm"
65206523
version = "0.52.6"
@@ -6527,12 +6530,6 @@ version = "0.53.0"
65276530
source = "registry+https://github.com/rust-lang/crates.io-index"
65286531
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
65296532

6530-
[[package]]
6531-
name = "windows_x86_64_msvc"
6532-
version = "0.48.5"
6533-
source = "registry+https://github.com/rust-lang/crates.io-index"
6534-
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
6535-
65366533
[[package]]
65376534
name = "windows_x86_64_msvc"
65386535
version = "0.52.6"

compiler/rustc_attr_parsing/src/attributes/crate_level.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,27 @@ impl<S: Stage> SingleAttributeParser<S> for PatternComplexityLimitParser {
176176
})
177177
}
178178
}
179+
180+
pub(crate) struct NoCoreParser;
181+
182+
impl<S: Stage> NoArgsAttributeParser<S> for NoCoreParser {
183+
const PATH: &[Symbol] = &[sym::no_core];
184+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
185+
// because it's a crate-level attribute, we already warn about it.
186+
// Putting target limitations here would give duplicate warnings
187+
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS);
188+
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoCore;
189+
const TYPE: AttributeType = AttributeType::CrateLevel;
190+
}
191+
192+
pub(crate) struct NoStdParser;
193+
194+
impl<S: Stage> NoArgsAttributeParser<S> for NoStdParser {
195+
const PATH: &[Symbol] = &[sym::no_std];
196+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
197+
// because it's a crate-level attribute, we already warn about it.
198+
// Putting target limitations here would give duplicate warnings
199+
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS);
200+
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoStd;
201+
const TYPE: AttributeType = AttributeType::CrateLevel;
202+
}

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use crate::attributes::codegen_attrs::{
2525
};
2626
use crate::attributes::confusables::ConfusablesParser;
2727
use crate::attributes::crate_level::{
28-
CrateNameParser, MoveSizeLimitParser, PatternComplexityLimitParser, RecursionLimitParser,
29-
TypeLengthLimitParser,
28+
CrateNameParser, MoveSizeLimitParser, NoCoreParser, NoStdParser, PatternComplexityLimitParser,
29+
RecursionLimitParser, TypeLengthLimitParser,
3030
};
3131
use crate::attributes::deprecation::DeprecationParser;
3232
use crate::attributes::dummy::DummyParser;
@@ -223,8 +223,10 @@ attribute_parsers!(
223223
Single<WithoutArgs<MacroEscapeParser>>,
224224
Single<WithoutArgs<MarkerParser>>,
225225
Single<WithoutArgs<MayDangleParser>>,
226+
Single<WithoutArgs<NoCoreParser>>,
226227
Single<WithoutArgs<NoImplicitPreludeParser>>,
227228
Single<WithoutArgs<NoMangleParser>>,
229+
Single<WithoutArgs<NoStdParser>>,
228230
Single<WithoutArgs<NonExhaustiveParser>>,
229231
Single<WithoutArgs<ParenSugarParser>>,
230232
Single<WithoutArgs<PassByValueParser>>,

compiler/rustc_codegen_llvm/src/va_arg.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,21 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
908908
)
909909
}
910910
"aarch64" => emit_aapcs_va_arg(bx, addr, target_ty),
911+
"arm" => {
912+
// Types wider than 16 bytes are not currently supported. Clang has special logic for
913+
// such types, but `VaArgSafe` is not implemented for any type that is this large.
914+
assert!(bx.cx.size_of(target_ty).bytes() <= 16);
915+
916+
emit_ptr_va_arg(
917+
bx,
918+
addr,
919+
target_ty,
920+
PassMode::Direct,
921+
SlotSize::Bytes4,
922+
AllowHigherAlign::Yes,
923+
ForceRightAdjust::No,
924+
)
925+
}
911926
"s390x" => emit_s390x_va_arg(bx, addr, target_ty),
912927
"powerpc" => emit_powerpc_va_arg(bx, addr, target_ty),
913928
"powerpc64" | "powerpc64le" => emit_ptr_va_arg(

compiler/rustc_codegen_ssa/src/back/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl Command {
109109
}
110110
Program::Lld(ref p, flavor) => {
111111
let mut c = process::Command::new(p);
112-
c.arg("-flavor").arg(flavor.as_str());
112+
c.arg("-flavor").arg(flavor.desc());
113113
c
114114
}
115115
};

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
520520
LocalRef::Place(va_list) => {
521521
bx.va_end(va_list.val.llval);
522522

523-
// Explicitly end the lifetime of the `va_list`, this matters for LLVM.
523+
// Explicitly end the lifetime of the `va_list`, improves LLVM codegen.
524524
bx.lifetime_end(va_list.val.llval, va_list.layout.size);
525525
}
526526
_ => bug!("C-variadic function must have a `VaList` place"),

compiler/rustc_codegen_ssa/src/mir/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,10 @@ fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
438438

439439
if fx.fn_abi.c_variadic && arg_index == fx.fn_abi.args.len() {
440440
let va_list = PlaceRef::alloca(bx, bx.layout_of(arg_ty));
441+
442+
// Explicitly start the lifetime of the `va_list`, improves LLVM codegen.
443+
bx.lifetime_start(va_list.val.llval, va_list.layout.size);
444+
441445
bx.va_start(va_list.val.llval);
442446

443447
return LocalRef::Place(va_list);

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,10 @@ fn print_crate_info(
668668
TargetSpecJson => {
669669
println_info!("{}", serde_json::to_string_pretty(&sess.target.to_json()).unwrap());
670670
}
671+
TargetSpecJsonSchema => {
672+
let schema = rustc_target::spec::json_schema();
673+
println_info!("{}", serde_json::to_string_pretty(&schema).unwrap());
674+
}
671675
AllTargetSpecsJson => {
672676
let mut targets = BTreeMap::new();
673677
for name in rustc_target::spec::TARGETS {

compiler/rustc_expand/src/mbe/transcribe.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,11 +940,27 @@ fn extract_symbol_from_pnr<'a>(
940940
{
941941
Ok(*symbol)
942942
}
943+
ParseNtResult::Literal(expr)
944+
if let ExprKind::Lit(lit @ Lit { kind: LitKind::Integer, symbol, suffix }) =
945+
&expr.kind =>
946+
{
947+
if lit.is_semantic_float() {
948+
Err(dcx
949+
.struct_err("floats are not supported as metavariables of `${concat(..)}`")
950+
.with_span(span_err))
951+
} else if suffix.is_none() {
952+
Ok(*symbol)
953+
} else {
954+
Err(dcx
955+
.struct_err("integer metavariables of `${concat(..)}` must not be suffixed")
956+
.with_span(span_err))
957+
}
958+
}
943959
_ => Err(dcx
944960
.struct_err(
945961
"metavariables of `${concat(..)}` must be of type `ident`, `literal` or `tt`",
946962
)
947-
.with_note("currently only string literals are supported")
963+
.with_note("currently only string and integer literals are supported")
948964
.with_span(span_err)),
949965
}
950966
}

0 commit comments

Comments
 (0)