Use Edition::CURRENT

This commit is contained in:
Lukas Wirth 2024-04-14 15:29:09 +02:00
parent 9c75e9fa7d
commit 83370fe5d7
16 changed files with 17 additions and 19 deletions

View file

@ -207,7 +207,7 @@ fn parse_adt(tt: &tt::Subtree, call_site: Span) -> Result<BasicAdtInfo, ExpandEr
let (parsed, tm) = &mbe::token_tree_to_syntax_node(
tt,
mbe::TopEntryPoint::MacroItems,
parser::Edition::Edition2021,
parser::Edition::CURRENT,
);
let macro_items = ast::MacroItems::cast(parsed.syntax_node())
.ok_or_else(|| ExpandError::other("invalid item definition"))?;

View file

@ -676,7 +676,7 @@ fn token_tree_to_syntax_node(
ExpandTo::Type => mbe::TopEntryPoint::Type,
ExpandTo::Expr => mbe::TopEntryPoint::Expr,
};
mbe::token_tree_to_syntax_node(tt, entry_point, parser::Edition::Edition2021)
mbe::token_tree_to_syntax_node(tt, entry_point, parser::Edition::CURRENT)
}
fn check_tt_count(tt: &tt::Subtree) -> Result<(), ExpandResult<()>> {

View file

@ -420,7 +420,7 @@ mod tests {
let (parse, _) = mbe::token_tree_to_syntax_node(
&tt,
::mbe::TopEntryPoint::MacroItems,
parser::Edition::Edition2021,
parser::Edition::CURRENT,
);
assert!(
parse.errors().is_empty(),

View file

@ -303,6 +303,7 @@ pub mod known {
rust_2015,
rust_2018,
rust_2021,
rust_2024,
v1,
new_display,
new_debug,