-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
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
ICE: resolve_trait_associated_const: unexpected vtable type #29924
Comments
Triaging: this issue is already being tracked on https://github.com/steveklabnik/glacier Reference: rust-lang/glacier#144 |
Still happens as of |
As of #![feature(associated_consts)]
trait Trait {
const N: usize;
}
fn n() -> usize {
<Trait as Trait>::N
} |
The first example doesn't compile due to the trait not being object safe and the last example also doesn't compile today. Neither ICEs; E-needstest. |
@Mark-Simulacrum pub enum Foo {}
pub trait Food {
const FOO: Foo;
}
pub trait Bard {
type Foo: Food;
fn get_foo() -> Foo { Self::Foo::FOO }
} Error on Rust-1.20 (playground):
Note: this is sort of a blocker for us to get use of the associated consts. |
@kvark this is already fixed on beta/nightly |
@oli-obk great, but what about stable? No hot patches planned? |
We generally do not backport patches to stable unless they are critical bug fixes (for which I don't think I can give a concrete definition). We should have a stable out with the fix in 6 weeks, though. |
Closes rust-lang#29924. Closes rust-lang#38857. Closes rust-lang#39665. Closes rust-lang#39872. Closes rust-lang#39553. Closes rust-lang#41210. Closes rust-lang#41880. Closes rust-lang#43483.
the following code ices on nightly:
It should give an error instead noting that you can't do
Self::N
.The text was updated successfully, but these errors were encountered: