-
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-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics
Description
I think this code shows a bad error message:
trait Foo { const FOO: Self; }
impl Foo for u32 { const FOO: Self = 1; }
fn bar<T: Foo>(n: T) {
const BASE: T = T::FOO;
}
fn main() {}
rustc 1.22.0-nightly (4279e2b 2017-10-21) gives:
error[E0401]: can't use type parameters from outer function; try using a local type parameter instead
--> ...\test.rs:4:17
|
4 | const BASE: T = T::FOO;
| ^ use of type variable from outer function
error[E0401]: can't use type parameters from outer function; try using a local type parameter instead
--> ...\test.rs:4:21
|
4 | const BASE: T = T::FOO;
| ^^^^^^ use of type variable from outer function
error: aborting due to 2 previous errors
Timmmm and nickmertin
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-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.WG-diagnosticsWorking group: DiagnosticsWorking group: Diagnostics