Open
Description
This code:
mod foo {
use super::NonZeroU8;
pub(crate) fn bar() -> NonZeroU8 {
NonZeroU8::new(1).unwrap()
}
}
use foo::bar;
fn main() {
let y = NonZeroU8::new(2).unwrap();
}
Trying to compile it with rustc (1.54.0-nightly 5c02926 2021-05-11), it gives:
error[E0432]: unresolved import `super::NonZeroU8`
--> ...\test.rs:2:9
|
2 | use super::NonZeroU8;
| ^^^^^^^^^^^^^^^^ no `NonZeroU8` in the root
error[E0433]: failed to resolve: use of undeclared type `NonZeroU8`
--> ...\test.rs:12:13
|
12 | let y = NonZeroU8::new(2).unwrap();
| ^^^^^^^^^ not found in this scope
|
help: consider importing one of these items
|
9 | use core::num::NonZeroU8;
|
9 | use std::num::NonZeroU8;
|
I'd like to see the 'use std::num::NonZeroU8;' help for the first unresolved import in the module too.