Do not mention a reexported item if it's private

This commit is contained in:
Yuki Okushi 2021-10-21 20:23:34 +09:00
parent 4626184caf
commit 3b2dd702fc
No known key found for this signature in database
GPG key ID: DABA5B072961C18A
3 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,21 @@
mod list {
pub use self::List::Cons;
pub enum List<T> {
Cons(T, Box<List<T>>),
}
}
mod alias {
use crate::list::List;
pub type Foo = List<String>;
}
fn foo(l: crate::alias::Foo) {
match l {
Cons(..) => {} //~ ERROR: cannot find tuple struct or tuple variant `Cons` in this scope
}
}
fn main() {}

View file

@ -0,0 +1,14 @@
error[E0531]: cannot find tuple struct or tuple variant `Cons` in this scope
--> $DIR/issue-90113.rs:17:9
|
LL | Cons(..) => {}
| ^^^^ not found in this scope
|
help: consider importing this tuple variant
|
LL | use list::List::Cons;
|
error: aborting due to previous error
For more information about this error, try `rustc --explain E0531`.