Skip to content

Commit a2d17a6

Browse files
Rollup merge of rust-lang#137333 - compiler-errors:edition-2024-fresh, r=Nadrieril
Use `edition = "2024"` in the compiler (redux) Most of this is binding mode changes, which I fixed by running `x.py fix`. Also adds some miscellaneous `unsafe` blocks for new unsafe standard library functions (the setenv ones), and a missing `unsafe extern` block in some enzyme codegen code, and fixes some precise capturing lifetime changes (but only when they led to errors). cc ``@ehuss`` ``@traviscross``
2 parents f78a051 + c10f47d commit a2d17a6

File tree

148 files changed

+258
-279
lines changed

Some content is hidden

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

148 files changed

+258
-279
lines changed

compiler/rustc/Cargo.toml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 9 additions & 9 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)