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`.
Activity
camelid commentedon Oct 20, 2021
Bisected to a rollup, but I think it's very likely to be #88838. cc @FabianWolff @estebank
searched nightlies: from nightly-2021-10-01 to nightly-2021-10-19
regressed nightly: nightly-2021-10-02
searched commits: from aa7aca3 to c02371c
regressed commit: 69eb996
bisected with cargo-bisect-rustc v0.6.0
Host triple: x86_64-apple-darwin
Reproduce with:
camelid commentedon Oct 20, 2021
The old suggestion was actually incorrect because it suggested
crate::alias::List::Cons
, which is a private import. However, the new error is "more incorrect" IMO since it says something confusing (and incorrect).apiraino commentedon Oct 21, 2021
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.
@rustbot label -I-prioritize +P-medium
Rollup merge of rust-lang#90127 - JohnTitor:fix-90113, r=estebank