Skip to content

Commit 2aff615

Browse files
committed
Auto merge of rust-lang#137352 - workingjubilee:rollup-mwikym3, r=<try>
Rollup of 10 pull requests Successful merges: - rust-lang#128080 (Specify scope in `out_of_scope_macro_calls` lint) - rust-lang#135630 (add more `s390x` target features) - rust-lang#136089 (Reduce `Box::default` stack copies in debug mode) - rust-lang#137192 (Remove obsolete Windows ThinLTO+TLS workaround) - rust-lang#137204 (Clarify MIR dialects and phases) - rust-lang#137299 (Simplify `Postorder` customization.) - rust-lang#137302 (Use a probe to avoid registering stray region obligations when re-checking drops in MIR typeck) - rust-lang#137305 (Tweaks in and around `rustc_middle`) - rust-lang#137313 (Some codegen_llvm cleanups) - rust-lang#137333 (Use `edition = "2024"` in the compiler (redux)) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-gnu try-job: armhf-gnu try-job: i686-mingw-1 try-job: i686-mingw-2 try-job: i686-mingw-3 try-job: test-various try-job: x86_64-gnu-nopt try-job: x86_64-msvc-1 try-job: x86_64-msvc-2
2 parents f04bbc6 + a2d17a6 commit 2aff615

File tree

187 files changed

+639
-591
lines changed

Some content is hidden

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

187 files changed

+639
-591
lines changed

compiler/rustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc-main"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_abi/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_abi"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_abi/src/lib.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -329,19 +329,19 @@ impl TargetDataLayout {
329329
[p] if p.starts_with('P') => {
330330
dl.instruction_address_space = parse_address_space(&p[1..], "P")?
331331
}
332-
["a", ref a @ ..] => dl.aggregate_align = parse_align(a, "a")?,
333-
["f16", ref a @ ..] => dl.f16_align = parse_align(a, "f16")?,
334-
["f32", ref a @ ..] => dl.f32_align = parse_align(a, "f32")?,
335-
["f64", ref a @ ..] => dl.f64_align = parse_align(a, "f64")?,
336-
["f128", ref a @ ..] => dl.f128_align = parse_align(a, "f128")?,
332+
["a", a @ ..] => dl.aggregate_align = parse_align(a, "a")?,
333+
["f16", a @ ..] => dl.f16_align = parse_align(a, "f16")?,
334+
["f32", a @ ..] => dl.f32_align = parse_align(a, "f32")?,
335+
["f64", a @ ..] => dl.f64_align = parse_align(a, "f64")?,
336+
["f128", a @ ..] => dl.f128_align = parse_align(a, "f128")?,
337337
// FIXME(erikdesjardins): we should be parsing nonzero address spaces
338338
// this will require replacing TargetDataLayout::{pointer_size,pointer_align}
339339
// with e.g. `fn pointer_size_in(AddressSpace)`
340-
[p @ "p", s, ref a @ ..] | [p @ "p0", s, ref a @ ..] => {
340+
[p @ "p", s, a @ ..] | [p @ "p0", s, a @ ..] => {
341341
dl.pointer_size = parse_size(s, p)?;
342342
dl.pointer_align = parse_align(a, p)?;
343343
}
344-
[s, ref a @ ..] if s.starts_with('i') => {
344+
[s, a @ ..] if s.starts_with('i') => {
345345
let Ok(bits) = s[1..].parse::<u64>() else {
346346
parse_size(&s[1..], "i")?; // For the user error.
347347
continue;
@@ -362,7 +362,7 @@ impl TargetDataLayout {
362362
dl.i128_align = a;
363363
}
364364
}
365-
[s, ref a @ ..] if s.starts_with('v') => {
365+
[s, a @ ..] if s.starts_with('v') => {
366366
let v_size = parse_size(&s[1..], "v")?;
367367
let a = parse_align(a, s)?;
368368
if let Some(v) = dl.vector_align.iter_mut().find(|v| v.0 == v_size) {
@@ -1805,7 +1805,7 @@ where
18051805
variants,
18061806
max_repr_align,
18071807
unadjusted_abi_align,
1808-
ref randomization_seed,
1808+
randomization_seed,
18091809
} = self;
18101810
f.debug_struct("Layout")
18111811
.field("size", size)

compiler/rustc_arena/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_arena"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_ast/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_ast"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_ast/src/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ pub fn walk_use_tree<'a, V: Visitor<'a>>(
597597
visit_opt!(visitor, visit_ident, rename);
598598
}
599599
UseTreeKind::Glob => {}
600-
UseTreeKind::Nested { ref items, span: _ } => {
600+
UseTreeKind::Nested { items, span: _ } => {
601601
for &(ref nested_tree, nested_id) in items {
602602
try_visit!(visitor.visit_use_tree(nested_tree, nested_id, true));
603603
}

compiler/rustc_ast_ir/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_ast_ir"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_ast_lowering/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_ast_lowering"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lib]
77
doctest = false

compiler/rustc_ast_passes/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_ast_passes"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_ast_pretty/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_ast_pretty"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_attr_data_structures/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_attr_data_structures"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_attr_parsing/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_attr_parsing"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_baked_icu_data/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_baked_icu_data"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_borrowck/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_borrowck"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2621,7 +2621,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
26212621
if let hir::Pat { kind: hir::PatKind::Binding(_, hir_id, _ident, _), .. } =
26222622
local.pat
26232623
&& let Some(init) = local.init
2624-
&& let hir::Expr {
2624+
&& let &hir::Expr {
26252625
kind:
26262626
hir::ExprKind::Closure(&hir::Closure {
26272627
kind: hir::ClosureKind::Closure,

compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
262262
fn visit_expr(&mut self, expr: &'hir hir::Expr<'hir>) {
263263
if let hir::ExprKind::If(cond, _conseq, _alt)
264264
| hir::ExprKind::Loop(
265-
hir::Block {
265+
&hir::Block {
266266
expr:
267267
Some(&hir::Expr {
268268
kind: hir::ExprKind::If(cond, _conseq, _alt),

compiler/rustc_borrowck/src/diagnostics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
11261126
let hir_id = self.infcx.tcx.local_def_id_to_hir_id(def_id);
11271127
let expr = &self.infcx.tcx.hir().expect_expr(hir_id).kind;
11281128
debug!("closure_span: hir_id={:?} expr={:?}", hir_id, expr);
1129-
if let hir::ExprKind::Closure(&hir::Closure { kind, fn_decl_span, .. }) = expr {
1129+
if let &hir::ExprKind::Closure(&hir::Closure { kind, fn_decl_span, .. }) = expr {
11301130
for (captured_place, place) in
11311131
self.infcx.tcx.closure_captures(def_id).iter().zip(places)
11321132
{

compiler/rustc_borrowck/src/diagnostics/region_name.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
682682
let mir_hir_id = self.mir_hir_id();
683683

684684
let (return_span, mir_description, hir_ty) = match tcx.hir_node(mir_hir_id) {
685-
hir::Node::Expr(hir::Expr {
685+
hir::Node::Expr(&hir::Expr {
686686
kind: hir::ExprKind::Closure(&hir::Closure { fn_decl, kind, fn_decl_span, .. }),
687687
..
688688
}) => {
@@ -874,7 +874,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
874874
.name;
875875

876876
let yield_span = match tcx.hir_node(self.mir_hir_id()) {
877-
hir::Node::Expr(hir::Expr {
877+
hir::Node::Expr(&hir::Expr {
878878
kind: hir::ExprKind::Closure(&hir::Closure { fn_decl_span, .. }),
879879
..
880880
}) => tcx.sess.source_map().end_point(fn_decl_span),

compiler/rustc_borrowck/src/polonius/dump.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn emit_polonius_mir<'tcx>(
226226
regioncx,
227227
closure_region_requirements,
228228
borrow_set,
229-
pass_where.clone(),
229+
pass_where,
230230
out,
231231
)?;
232232

compiler/rustc_borrowck/src/type_check/liveness/trace.rs

+14-8
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,14 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
613613
// types, so there's no guarantee that it succeeds. We also
614614
// can't rely on the the `ErrorGuaranteed` from `fully_perform` here
615615
// because it comes from delay_span_bug.
616-
let ocx = ObligationCtxt::new_with_diagnostics(&typeck.infcx);
617-
let errors =
618-
match dropck_outlives::compute_dropck_outlives_with_errors(&ocx, op, span) {
616+
//
617+
// Do this inside of a probe because we don't particularly care (or want)
618+
// any region side-effects of this operation in our infcx.
619+
typeck.infcx.probe(|_| {
620+
let ocx = ObligationCtxt::new_with_diagnostics(&typeck.infcx);
621+
let errors = match dropck_outlives::compute_dropck_outlives_with_errors(
622+
&ocx, op, span,
623+
) {
619624
Ok(_) => ocx.select_all_or_error(),
620625
Err(e) => {
621626
if e.is_empty() {
@@ -626,11 +631,12 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
626631
}
627632
};
628633

629-
if !errors.is_empty() {
630-
typeck.infcx.err_ctxt().report_fulfillment_errors(errors);
631-
} else {
632-
span_bug!(span, "Rerunning drop data query produced no error.");
633-
}
634+
if !errors.is_empty() {
635+
typeck.infcx.err_ctxt().report_fulfillment_errors(errors);
636+
} else {
637+
span_bug!(span, "Rerunning drop data query produced no error.");
638+
}
639+
});
634640
DropData { dropck_result: Default::default(), region_constraint_data: None }
635641
}
636642
}

compiler/rustc_borrowck/src/universal_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl<'tcx> UniversalRegions<'tcx> {
308308

309309
/// Returns an iterator over all the RegionVids corresponding to
310310
/// universally quantified free regions.
311-
pub(crate) fn universal_regions_iter(&self) -> impl Iterator<Item = RegionVid> {
311+
pub(crate) fn universal_regions_iter(&self) -> impl Iterator<Item = RegionVid> + use<> {
312312
(FIRST_GLOBAL_INDEX..self.num_universals).map(RegionVid::from_usize)
313313
}
314314

compiler/rustc_builtin_macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_builtin_macros"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66

77
[lints.rust]

compiler/rustc_codegen_llvm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_codegen_llvm"
33
version = "0.0.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lib]
77
test = false

compiler/rustc_codegen_llvm/src/back/lto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ fn fat_lto(
362362
ptr as *const *const libc::c_char,
363363
symbols_below_threshold.len() as libc::size_t,
364364
);
365-
save_temp_bitcode(cgcx, &module, "lto.after-restriction");
366365
}
366+
save_temp_bitcode(cgcx, &module, "lto.after-restriction");
367367
}
368368

369369
Ok(LtoModuleCodegen::Fat(module))

0 commit comments

Comments
 (0)