Open
Description
rust-analyzer version: rust-analyzer 1.80.0-nightly (7c52d2d 2024-06-03)
rustc version: rustc 1.80.0-nightly (7c52d2db6 2024-06-03)
editor or extension: neovim
relevant settings: None
repository link (if public, optional): None. But I found the problem from embassy-executor. For reproducible code, see below.
code snippet to reproduce:
// src/main.rs
fn main() {
submod::f();
}
#[cfg_attr(feature = "gated", path = "submod_gated.rs")]
mod submod;
// src/submod.rs
pub fn f() {
println!("from submod.rs");
}
// src/submod_gated.rs
pub fn f() {
println!("from submod_gated.rs");
}
# Cargo.toml
[features]
gated = []
Currently, RA marks submod.rs
as file not included in crate hierarchy
when gated
feature is nowhere enabled, and treats submod_gated.rs
as the default submod file, discarding cfg_attr
.