Closed
Description
MCVE
mod list {
pub use 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(hd, tl) => {}
}
}
New error (incorrect)
error[E0531]: cannot find tuple struct or tuple variant `Cons` in this scope
--> src/lib.rs:17:9
|
17 | Cons(hd, tl) => {}
| ^^^^ not found in this scope
|
note: tuple variant `crate::alias::List::Cons` exists but is inaccessible
--> src/lib.rs:5:9
|
5 | Cons(T, Box<List<T>>),
| ^^^^^^^^^^^^^^^^^^^^^ not accessible
For more information about this error, try `rustc --explain E0531`.
Old error (correct)
error[E0531]: cannot find tuple struct or tuple variant `Cons` in this scope
--> src/lib.rs:17:9
|
17 | Cons(hd, tl) => {}
| ^^^^ not found in this scope
|
help: consider importing this tuple variant
|
1 | use crate::alias::List::Cons;
|
For more information about this error, try `rustc --explain E0531`.