Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 83370fe

Browse files
committed
Use Edition::CURRENT
1 parent 9c75e9f commit 83370fe

File tree

16 files changed

+17
-19
lines changed

16 files changed

+17
-19
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/hir-def/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ cfg.workspace = true
4444
tt.workspace = true
4545
limit.workspace = true
4646
span.workspace = true
47-
parser.workspace = true
4847

4948

5049
[dev-dependencies]

crates/hir-def/src/macro_expansion_tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl ProcMacroExpander for IdentityWhenValidProcMacroExpander {
319319
let (parse, _) = ::mbe::token_tree_to_syntax_node(
320320
subtree,
321321
::mbe::TopEntryPoint::MacroItems,
322-
parser::Edition::Edition2021,
322+
span::Edition::CURRENT,
323323
);
324324
if parse.errors().is_empty() {
325325
Ok(subtree.clone())

crates/hir-def/src/nameres/collector.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,7 @@ impl DefCollector<'_> {
534534
Edition::Edition2015 => name![rust_2015],
535535
Edition::Edition2018 => name![rust_2018],
536536
Edition::Edition2021 => name![rust_2021],
537-
// FIXME: update this when rust_2024 exists
538-
Edition::Edition2024 => name![rust_2021],
537+
Edition::Edition2024 => name![rust_2024],
539538
};
540539

541540
let path_kind = match self.def_map.data.edition {

crates/hir-expand/src/builtin_derive_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn parse_adt(tt: &tt::Subtree, call_site: Span) -> Result<BasicAdtInfo, ExpandEr
207207
let (parsed, tm) = &mbe::token_tree_to_syntax_node(
208208
tt,
209209
mbe::TopEntryPoint::MacroItems,
210-
parser::Edition::Edition2021,
210+
parser::Edition::CURRENT,
211211
);
212212
let macro_items = ast::MacroItems::cast(parsed.syntax_node())
213213
.ok_or_else(|| ExpandError::other("invalid item definition"))?;

crates/hir-expand/src/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ fn token_tree_to_syntax_node(
676676
ExpandTo::Type => mbe::TopEntryPoint::Type,
677677
ExpandTo::Expr => mbe::TopEntryPoint::Expr,
678678
};
679-
mbe::token_tree_to_syntax_node(tt, entry_point, parser::Edition::Edition2021)
679+
mbe::token_tree_to_syntax_node(tt, entry_point, parser::Edition::CURRENT)
680680
}
681681

682682
fn check_tt_count(tt: &tt::Subtree) -> Result<(), ExpandResult<()>> {

crates/hir-expand/src/fixup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ mod tests {
420420
let (parse, _) = mbe::token_tree_to_syntax_node(
421421
&tt,
422422
::mbe::TopEntryPoint::MacroItems,
423-
parser::Edition::Edition2021,
423+
parser::Edition::CURRENT,
424424
);
425425
assert!(
426426
parse.errors().is_empty(),

crates/hir-expand/src/name.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ pub mod known {
303303
rust_2015,
304304
rust_2018,
305305
rust_2021,
306+
rust_2024,
306307
v1,
307308
new_display,
308309
new_debug,

crates/hir-ty/src/method_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ fn iterate_trait_method_candidates(
11571157
{
11581158
// FIXME: this should really be using the edition of the method name's span, in case it
11591159
// comes from a macro
1160-
if db.crate_graph()[krate].edition < Edition::Edition2021 {
1160+
if db.crate_graph()[krate].edition < Edition::CURRENT {
11611161
continue;
11621162
}
11631163
}

crates/mbe/src/expander/matcher.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ fn match_meta_var(
744744
let fragment = match kind {
745745
MetaVarKind::Path => {
746746
return input
747-
.expect_fragment(parser::PrefixEntryPoint::Path, parser::Edition::Edition2021)
747+
.expect_fragment(parser::PrefixEntryPoint::Path, parser::Edition::CURRENT)
748748
.map(|it| {
749749
it.map(|it| tt::TokenTree::subtree_or_wrap(it, delim_span)).map(Fragment::Path)
750750
});
@@ -773,7 +773,7 @@ fn match_meta_var(
773773
_ => {}
774774
};
775775
return input
776-
.expect_fragment(parser::PrefixEntryPoint::Expr, parser::Edition::Edition2021)
776+
.expect_fragment(parser::PrefixEntryPoint::Expr, parser::Edition::CURRENT)
777777
.map(|tt| {
778778
tt.map(|tt| match tt {
779779
tt::TokenTree::Leaf(leaf) => tt::Subtree {
@@ -823,7 +823,7 @@ fn match_meta_var(
823823
return tt_result.map(|it| Some(Fragment::Tokens(it))).into();
824824
}
825825
};
826-
input.expect_fragment(fragment, parser::Edition::Edition2021).map(|it| it.map(Fragment::Tokens))
826+
input.expect_fragment(fragment, parser::Edition::CURRENT).map(|it| it.map(Fragment::Tokens))
827827
}
828828

829829
fn collect_vars(collector_fun: &mut impl FnMut(SmolStr), pattern: &MetaTemplate) {

0 commit comments

Comments
 (0)