Open jonasbb opened 2 years ago
Huh, interesting, our import infra doesn't handle reexported crates at all, so nothing in Actually that's not true, eyre
is seen from a crate that only depends on color-eyre
.ImportMap
handles reexports across crates.
This is caused by the reexports of the eyre!
macro and can be reproduced using this lib.rs
(both reexports are needed):
#[macro_export]
macro_rules! eyre {
() => {};
}
pub use eyre as format_err;
pub use eyre as anyhow;
In this code snippet, rust-analyzer correctly shows the "unresolved macro
eyre!
" error. The code action suggests to import/qualify the macro ascolor_eyre::eyre
which does not work, sincecolor_eyre::eyre
is the re-export of theeyre
crate. The correct path iscolor_eyre::eyre::eyre
. The error happens with the standard configuration of rust-analyzer. The wrong path suggestion does not come from rustc, since it is not in thecargo check
error message.rust-analyzer version: 04f03a360 2021-11-01 stable VSCode: 1.62