-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
A-nameresname, path and module resolutionname, path and module resolutionC-bugCategory: bugCategory: bug
Description
// check-pass
// tests/ui/imports/import-after-macro-expand-11.rs
#[derive(Debug)]
struct H;
mod p {
use super::*;
// this struct confuses RA
#[derive(Clone)]
struct H;
mod t {
use super::*;
fn f() {
let h: crate::p::H = H;
}
}
}
fn main() {}edition 2015
while this compiles with rustc, rust analyze throws an error:
warning: unused import: `super::*`
--> src/main.rs:8:9
|
8 | use super::*;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused variable: `h`
--> src/main.rs:18:16
|
18 | let h: crate::p::H = H;
| ^ help: if this is intentional, prefix it with an underscore: `_h`
|
= note: `#[warn(unused_variables)]` on by default
warning: function `f` is never used
--> src/main.rs:17:12
|
17 | fn f() {
| ^
|
= note: `#[warn(dead_code)]` on by default
warning: `bar` (bin "bar") generated 3 warnings (run `cargo fix --bin "bar"` to apply 2 suggestions)
processing crate: bar, module: /tmp/bar/src/main.rs
Diagnostic { code: RustcHardError("E0308"), message: "expected H, found H", range: FileRange { file_id: FileId(11), range: 273..274 }, severity: Error, unused: false, experimental: true, fixes: None, main_node: None }
diagnostic scan complete
Error: diagnostic error detected
rust-analyzer 1.77.0-nightly (595bc6f 2024-01-05)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-nameresname, path and module resolutionname, path and module resolutionC-bugCategory: bugCategory: bug