I understand the #[prelude_import]
attribute is nightly, but I want to use it anyway. It seems like it works:
#![feature(prelude_import)]
pub mod p {
pub fn f() {
println!("Hi!");
}
}
#[prelude_import]
use p::*;
mod q {
pub fn q() {
f();
}
}
fn main() {
q::q();
}
It prints Hello!
, however the compiler says:
warning: unused import: `p::*`
--> src/main.rs:10:5
|
10 | use p::*;
| ^^^^
I can probably disable the warning, but why does it happen?