We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Either a bug or a bad error message.
#![feature(associated_consts)] trait Foo { type Associated; const ID: Self::Associated; } impl Foo for i32 { type Associated = f32; const ID: f32 = 1f32; } fn main() { assert_eq!(1f32, i32::ID); }
Results in
<anon>:5:5: 5:32 error: the trait `Foo` is not implemented for the type `Self` [E0277] <anon>:5 const ID: Self::Associated;
The text was updated successfully, but these errors were encountered:
Not sure if it's easier or harder to debug, but it also occurs when separated into 2 traits:
#![feature(associated_consts)] trait Foo { type Associated; } trait FooConst: Foo { const ID: <Self as Foo>::Associated; } impl Foo for i32 { type Associated = f32; } impl FooConst for i32 { const ID: f32 = 1f32; } fn main() { assert_eq!(1f32, i32::ID); }
Sorry, something went wrong.
No longer repros as of rustc 1.14.0-nightly (6e8f92f 2016-10-07).
No branches or pull requests
Either a bug or a bad error message.
Results in
The text was updated successfully, but these errors were encountered: