Create a new library crate project with dependencies derive_more and parse-display.
In lib.rs, define the following struct:
struct Example(i32);
Add #[derive(Display)] on the line above. While typing, observe that Auto Import correctly suggests parse_display::Display. Remove the derive attribute.
Add #[derive(From)] on the line above the struct definition. While typing, observe that Auto Import does not suggest derive_more::From.
To fix the error, replace From with derive_more::From. Observe that the macro resolves and the code compiles.
This is not a duplicate of #6183 because
procMacro.enable
is set totrue
.rust-analyzer version: 0.3.1983-standalone (7852a4c77 2024-06-02)
rustc version: 1.78.0 (9b00956e5 2024-04-29)
editor or extension: VSCode
relevant settings:
"rust-analyzer.completion.autoimport": true
"rust-analyzer.procMacro.enable": true
to reproduce:
derive_more
andparse-display
.lib.rs
, define the following struct:#[derive(Display)]
on the line above. While typing, observe that Auto Import correctly suggestsparse_display::Display
. Remove the derive attribute.#[derive(From)]
on the line above the struct definition. While typing, observe that Auto Import does not suggestderive_more::From
.From
withderive_more::From
. Observe that the macro resolves and the code compiles.