Skip to content

Commit 36dbcae

Browse files
committed
Auto merge of #122960 - ehuss:edition-2024-crater-test, r=<try>
Crater 2024 edition test
2 parents af4a5a1 + 561eebd commit 36dbcae

File tree

8 files changed

+70
-69
lines changed

8 files changed

+70
-69
lines changed

.gitmodules

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
shallow = true
55
[submodule "src/tools/cargo"]
66
path = src/tools/cargo
7-
url = https://github.com/rust-lang/cargo.git
7+
url = https://github.com/ehuss/cargo.git
8+
branch = "edition-2024-crater"
89
shallow = true
910
[submodule "src/doc/reference"]
1011
path = src/doc/reference

compiler/rustc_ast_lowering/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1540,8 +1540,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15401540
if matches!(
15411541
fn_kind.expect("expected RPITs to be lowered with a FnKind"),
15421542
FnDeclKind::Impl | FnDeclKind::Trait
1543-
) || self.tcx.features().lifetime_capture_rules_2024
1544-
|| span.at_least_rust_2024()
1543+
) || (self.tcx.features().lifetime_capture_rules_2024
1544+
&& span.at_least_rust_2024())
15451545
{
15461546
// return-position impl trait in trait was decided to capture all
15471547
// in-scope lifetimes, which we collect for all opaques during resolution.

compiler/rustc_hir_analysis/src/check/errs.rs

+20-20
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,28 @@ fn handle_static_mut_ref(
5252
tcx: TyCtxt<'_>,
5353
span: Span,
5454
var: String,
55-
e2024: bool,
55+
_e2024: bool,
5656
mutable: Mutability,
5757
hir_id: hir::HirId,
5858
) {
59-
if e2024 {
60-
let (sugg, shared) = if mutable == Mutability::Mut {
61-
(errors::StaticMutRefSugg::Mut { span, var }, "mutable")
62-
} else {
63-
(errors::StaticMutRefSugg::Shared { span, var }, "shared")
64-
};
65-
tcx.sess.psess.dcx.emit_err(errors::StaticMutRef { span, sugg, shared });
59+
// if e2024 {
60+
// let (sugg, shared) = if mutable == Mutability::Mut {
61+
// (errors::StaticMutRefSugg::Mut { span, var }, "mutable")
62+
// } else {
63+
// (errors::StaticMutRefSugg::Shared { span, var }, "shared")
64+
// };
65+
// tcx.sess.psess.dcx.emit_err(errors::StaticMutRef { span, sugg, shared });
66+
// } else {
67+
let (sugg, shared) = if mutable == Mutability::Mut {
68+
(errors::RefOfMutStaticSugg::Mut { span, var }, "mutable")
6669
} else {
67-
let (sugg, shared) = if mutable == Mutability::Mut {
68-
(errors::RefOfMutStaticSugg::Mut { span, var }, "mutable")
69-
} else {
70-
(errors::RefOfMutStaticSugg::Shared { span, var }, "shared")
71-
};
72-
tcx.emit_node_span_lint(
73-
STATIC_MUT_REFS,
74-
hir_id,
75-
span,
76-
errors::RefOfMutStatic { span, sugg, shared },
77-
);
78-
}
70+
(errors::RefOfMutStaticSugg::Shared { span, var }, "shared")
71+
};
72+
tcx.emit_node_span_lint(
73+
STATIC_MUT_REFS,
74+
hir_id,
75+
span,
76+
errors::RefOfMutStatic { span, sugg, shared },
77+
);
78+
// }
7979
}

compiler/rustc_hir_analysis/src/errors.rs

+27-27
Original file line numberDiff line numberDiff line change
@@ -1498,36 +1498,36 @@ pub struct StaticMutRef<'a> {
14981498
#[primary_span]
14991499
#[label]
15001500
pub span: Span,
1501-
#[subdiagnostic]
1502-
pub sugg: StaticMutRefSugg,
1501+
// #[subdiagnostic]
1502+
// pub sugg: StaticMutRefSugg,
15031503
pub shared: &'a str,
15041504
}
15051505

1506-
#[derive(Subdiagnostic)]
1507-
pub enum StaticMutRefSugg {
1508-
#[suggestion(
1509-
hir_analysis_suggestion,
1510-
style = "verbose",
1511-
code = "addr_of!({var})",
1512-
applicability = "maybe-incorrect"
1513-
)]
1514-
Shared {
1515-
#[primary_span]
1516-
span: Span,
1517-
var: String,
1518-
},
1519-
#[suggestion(
1520-
hir_analysis_suggestion_mut,
1521-
style = "verbose",
1522-
code = "addr_of_mut!({var})",
1523-
applicability = "maybe-incorrect"
1524-
)]
1525-
Mut {
1526-
#[primary_span]
1527-
span: Span,
1528-
var: String,
1529-
},
1530-
}
1506+
// #[derive(Subdiagnostic)]
1507+
// pub enum StaticMutRefSugg {
1508+
// #[suggestion(
1509+
// hir_analysis_suggestion,
1510+
// style = "verbose",
1511+
// code = "addr_of!({var})",
1512+
// applicability = "maybe-incorrect"
1513+
// )]
1514+
// Shared {
1515+
// #[primary_span]
1516+
// span: Span,
1517+
// var: String,
1518+
// },
1519+
// #[suggestion(
1520+
// hir_analysis_suggestion_mut,
1521+
// style = "verbose",
1522+
// code = "addr_of_mut!({var})",
1523+
// applicability = "maybe-incorrect"
1524+
// )]
1525+
// Mut {
1526+
// #[primary_span]
1527+
// span: Span,
1528+
// var: String,
1529+
// },
1530+
// }
15311531

15321532
// STATIC_MUT_REF lint
15331533
#[derive(LintDiagnostic)]

compiler/rustc_parse/src/parser/expr.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1521,15 +1521,15 @@ impl<'a> Parser<'a> {
15211521
Ok(this.mk_expr(this.prev_token.span, ExprKind::Underscore))
15221522
} else if this.token.uninterpolated_span().at_least_rust_2018() {
15231523
// `Span::at_least_rust_2018()` is somewhat expensive; don't get it repeatedly.
1524-
if this.token.uninterpolated_span().at_least_rust_2024()
1525-
// check for `gen {}` and `gen move {}`
1526-
// or `async gen {}` and `async gen move {}`
1527-
&& (this.is_gen_block(kw::Gen, 0)
1528-
|| (this.check_keyword(kw::Async) && this.is_gen_block(kw::Gen, 1)))
1529-
{
1530-
// FIXME: (async) gen closures aren't yet parsed.
1531-
this.parse_gen_block()
1532-
} else if this.check_keyword(kw::Async) {
1524+
// if this.token.uninterpolated_span().at_least_rust_2024()
1525+
// // check for `gen {}` and `gen move {}`
1526+
// // or `async gen {}` and `async gen move {}`
1527+
// && (this.is_gen_block(kw::Gen, 0)
1528+
// || (this.check_keyword(kw::Async) && this.is_gen_block(kw::Gen, 1)))
1529+
// {
1530+
// // FIXME: (async) gen closures aren't yet parsed.
1531+
// this.parse_gen_block()
1532+
if this.check_keyword(kw::Async) {
15331533
// FIXME(gen_blocks): Parse `gen async` and suggest swap
15341534
if this.is_gen_block(kw::Async, 0) {
15351535
// Check for `async {` and `async move {`,

compiler/rustc_parse/src/parser/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1201,14 +1201,14 @@ impl<'a> Parser<'a> {
12011201
return_impl_trait_id: DUMMY_NODE_ID,
12021202
})
12031203
}
1204-
} else if self.token.uninterpolated_span().at_least_rust_2024()
1205-
&& self.eat_keyword_case(kw::Gen, case)
1206-
{
1207-
Some(CoroutineKind::Gen {
1208-
span,
1209-
closure_id: DUMMY_NODE_ID,
1210-
return_impl_trait_id: DUMMY_NODE_ID,
1211-
})
1204+
// } else if self.token.uninterpolated_span().at_least_rust_2024()
1205+
// && self.eat_keyword_case(kw::Gen, case)
1206+
// {
1207+
// Some(CoroutineKind::Gen {
1208+
// span,
1209+
// closure_id: DUMMY_NODE_ID,
1210+
// return_impl_trait_id: DUMMY_NODE_ID,
1211+
// })
12121212
} else {
12131213
None
12141214
}

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ impl Symbol {
24072407

24082408
fn is_unused_keyword_conditional(self, edition: impl Copy + FnOnce() -> Edition) -> bool {
24092409
self == kw::Try && edition().at_least_rust_2018()
2410-
|| self == kw::Gen && edition().at_least_rust_2024()
2410+
// || self == kw::Gen && edition().at_least_rust_2024()
24112411
}
24122412

24132413
pub fn is_reserved(self, edition: impl Copy + FnOnce() -> Edition) -> bool {

src/tools/cargo

Submodule cargo updated 209 files

0 commit comments

Comments
 (0)