-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
pub use my_mod::MyStruct; // this pub use is causing the problem
mod my_mod {
#[derive(Debug)]
pub struct MyStruct(u32);
mod my_sub_mod {
use crate::MyStruct; // import the rexported struct
fn my_func() {
let s = MyStruct(42);
println!("MyStruct: {:?}", s);
}
}
}
Current output
error[E0423]: expected function, tuple struct or tuple variant, found struct `MyStruct`
--> src/lib.rs:11:21
|
11 | let s = MyStruct(42);
| ^^^^^^^^
For more information about this error, try `rustc --explain E0423`.
Desired output
Either having no error or the error saying the import is bad
Rust Version
rustc 1.81.0
Anything else?
This is a really confusing message that is not helping
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.