-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
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`.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.