Closed
Description
Reduced from RLS' source (on the Rust 2018 edition):
// Dummy import to introduce `uniform_paths` canaries.
use std;
// fn version() -> &'static str {""}
mod foo {
// Error *not* reported, despite `version` being commented out above!
use crate::version;
fn bar() {
version();
}
}
fn main() {}
The use std;
import is the one introducing the canaries - if it's changed to use ::std;
, the error for version
is emitted. With no import errors, various parts of the compiler can ICE.
(currently attempted .def_id() on invalid def: Err
, triggered by lints trying to run on foo::bar
)
I'll try to fix it during #54116, as it was discovered during my attempt to fix RLS for that PR.