chore: Bump Edition::CURRENT to 2024

This commit is contained in:
Lukas Wirth 2025-03-14 14:42:09 +01:00
parent 23e8d13531
commit a505420751
24 changed files with 277 additions and 244 deletions

View file

@ -56,7 +56,7 @@ impl Expander {
pub fn syntax_context(&self) -> SyntaxContext {
// FIXME:
SyntaxContext::root(Edition::CURRENT)
SyntaxContext::root(Edition::CURRENT_FIXME)
}
pub fn enter_expand<T: ast::AstNode>(

View file

@ -270,7 +270,7 @@ m!();
// AstId: 2
pub macro m2 { ... }
// AstId: 3, SyntaxContextId: ROOT2021, ExpandTo: Items
// AstId: 3, SyntaxContextId: ROOT2024, ExpandTo: Items
m!(...);
"#]],
);

View file

@ -35,7 +35,7 @@ macro_rules! f {
};
}
struct#0:1@58..64#20480# MyTraitMap2#0:2@31..42#ROOT2021# {#0:1@72..73#20480#
struct#0:1@58..64#20480# MyTraitMap2#0:2@31..42#ROOT2024# {#0:1@72..73#20480#
map#0:1@86..89#20480#:#0:1@89..90#20480# #0:1@89..90#20480#::#0:1@91..93#20480#std#0:1@93..96#20480#::#0:1@96..98#20480#collections#0:1@98..109#20480#::#0:1@109..111#20480#HashSet#0:1@111..118#20480#<#0:1@118..119#20480#(#0:1@119..120#20480#)#0:1@120..121#20480#>#0:1@121..122#20480#,#0:1@122..123#20480#
}#0:1@132..133#20480#
"#]],
@ -75,12 +75,12 @@ macro_rules! f {
};
}
fn#0:2@30..32#ROOT2021# main#0:2@33..37#ROOT2021#(#0:2@37..38#ROOT2021#)#0:2@38..39#ROOT2021# {#0:2@40..41#ROOT2021#
1#0:2@50..51#ROOT2021#;#0:2@51..52#ROOT2021#
1.0#0:2@61..64#ROOT2021#;#0:2@64..65#ROOT2021#
(#0:2@74..75#ROOT2021#(#0:2@75..76#ROOT2021#1#0:2@76..77#ROOT2021#,#0:2@77..78#ROOT2021# )#0:2@78..79#ROOT2021#,#0:2@79..80#ROOT2021# )#0:2@80..81#ROOT2021#.#0:2@81..82#ROOT2021#0#0:2@82..85#ROOT2021#.#0:2@82..85#ROOT2021#0#0:2@82..85#ROOT2021#;#0:2@85..86#ROOT2021#
let#0:2@95..98#ROOT2021# x#0:2@99..100#ROOT2021# =#0:2@101..102#ROOT2021# 1#0:2@103..104#ROOT2021#;#0:2@104..105#ROOT2021#
}#0:2@110..111#ROOT2021#
fn#0:2@30..32#ROOT2024# main#0:2@33..37#ROOT2024#(#0:2@37..38#ROOT2024#)#0:2@38..39#ROOT2024# {#0:2@40..41#ROOT2024#
1#0:2@50..51#ROOT2024#;#0:2@51..52#ROOT2024#
1.0#0:2@61..64#ROOT2024#;#0:2@64..65#ROOT2024#
(#0:2@74..75#ROOT2024#(#0:2@75..76#ROOT2024#1#0:2@76..77#ROOT2024#,#0:2@77..78#ROOT2024# )#0:2@78..79#ROOT2024#,#0:2@79..80#ROOT2024# )#0:2@80..81#ROOT2024#.#0:2@81..82#ROOT2024#0#0:2@82..85#ROOT2024#.#0:2@82..85#ROOT2024#0#0:2@82..85#ROOT2024#;#0:2@85..86#ROOT2024#
let#0:2@95..98#ROOT2024# x#0:2@99..100#ROOT2024# =#0:2@101..102#ROOT2024# 1#0:2@103..104#ROOT2024#;#0:2@104..105#ROOT2024#
}#0:2@110..111#ROOT2024#
"#]],
@ -171,7 +171,7 @@ fn main(foo: ()) {
}
fn main(foo: ()) {
/* error: unresolved macro unresolved */"helloworld!"#0:3@236..321#ROOT2021#;
/* error: unresolved macro unresolved */"helloworld!"#0:3@236..321#ROOT2024#;
}
}
@ -197,7 +197,7 @@ macro_rules! mk_struct {
#[macro_use]
mod foo;
struct#1:1@59..65#20480# Foo#0:2@32..35#ROOT2021#(#1:1@70..71#20480#u32#0:2@41..44#ROOT2021#)#1:1@74..75#20480#;#1:1@75..76#20480#
struct#1:1@59..65#20480# Foo#0:2@32..35#ROOT2024#(#1:1@70..71#20480#u32#0:2@41..44#ROOT2024#)#1:1@74..75#20480#;#1:1@75..76#20480#
"#]],
);
}
@ -424,8 +424,8 @@ macro_rules! m {
($($i:ident),*) => ( impl Bar { $(fn $i() {})* } );
}
impl#\20480# Bar#\20480# {#\20480#
fn#\20480# foo#\ROOT2021#(#\20480#)#\20480# {#\20480#}#\20480#
fn#\20480# bar#\ROOT2021#(#\20480#)#\20480# {#\20480#}#\20480#
fn#\20480# foo#\ROOT2024#(#\20480#)#\20480# {#\20480#}#\20480#
fn#\20480# bar#\ROOT2024#(#\20480#)#\20480# {#\20480#}#\20480#
}#\20480#
"#]],
);
@ -1408,7 +1408,7 @@ ok!();
macro_rules! m2 {
($($a:expr => $b:ident)* _ => $c:expr) => { ok!(); }
}
ok!();
/* error: unexpected token in input */ok!();
"#]],
);
}

View file

@ -162,9 +162,10 @@ fn test() {
}
#[test]
fn expr_dont_match_inline_const() {
fn expr_inline_const() {
check(
r#"
//- /lib.rs edition:2021
macro_rules! foo {
($e:expr) => { $e }
}
@ -181,6 +182,30 @@ macro_rules! foo {
fn test() {
/* error: no rule matches input tokens */missing;
}
"#]],
);
check(
r#"
//- /lib.rs edition:2024
macro_rules! foo {
($e:expr) => { $e }
}
fn test() {
foo!(const { 3 });
}
"#,
expect![[r#"
macro_rules! foo {
($e:expr) => { $e }
}
fn test() {
(const {
3
}
);
}
"#]],
);
}

View file

@ -181,9 +181,9 @@ fn foo(&self) {
self.0. 1;
}
fn#0:1@45..47#ROOT2021# foo#0:1@48..51#ROOT2021#(#0:1@51..52#ROOT2021#&#0:1@52..53#ROOT2021#self#0:1@53..57#ROOT2021# )#0:1@57..58#ROOT2021# {#0:1@59..60#ROOT2021#
self#0:1@65..69#ROOT2021# .#0:1@69..70#ROOT2021#0#0:1@70..71#ROOT2021#.#0:1@71..72#ROOT2021#1#0:1@73..74#ROOT2021#;#0:1@74..75#ROOT2021#
}#0:1@76..77#ROOT2021#"#]],
fn#0:1@45..47#ROOT2024# foo#0:1@48..51#ROOT2024#(#0:1@51..52#ROOT2024#&#0:1@52..53#ROOT2024#self#0:1@53..57#ROOT2024# )#0:1@57..58#ROOT2024# {#0:1@59..60#ROOT2024#
self#0:1@65..69#ROOT2024# .#0:1@69..70#ROOT2024#0#0:1@70..71#ROOT2024#.#0:1@71..72#ROOT2024#1#0:1@73..74#ROOT2024#;#0:1@74..75#ROOT2024#
}#0:1@76..77#ROOT2024#"#]],
);
}