Open
Description
rust-analyzer version: rust-analyzer version: 0.3.2519-standalone (6df1213 2025-06-29)
rustc version: rustc 1.90.0-nightly (667787527 2025-07-02)
editor or extension: VSCode
relevant settings: none
repository link (if public, optional): none
code snippet to reproduce:
- Change the
package.edtion
inCargo.toml
to"2021"
keyword
gen
is reserved beginning in the 2024 edition: https://doc.rust-lang.org/reference/keywords.html#r-lex.keywords.reserved.edition2024
- Try the follow code
fn gen() -> usize {
0
}
assert_eq!(gen(), 0);
ra:
expected Expr rust-analyzer [macro-error](https://rust-analyzer.github.io/book/diagnostics.html#macro-error)
Any expression whose path contains gen
will trigger this bug.
struct Foo;
impl Foo {
fn gen() -> usize {
1
}
}
assert_eq!(Foo::gen(), 1);
mod gen {
fn foo() -> usize {
1
}
}
assert_eq!(gen::foo(), 1);