-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Bogus associated type in associated type bound compiles #21259
Comments
use std::ops::Deref;
struct Foo<T> {
xs: [T; 0]
}
impl<T> Deref for Foo<T> {
type Target = [T];
fn deref(&self) -> <Self as Deref>::WhyDoesThisCompile {
123
}
}
fn main() {
} This (and the example in the original report) compiles today with
If you make |
Not a 1.0 blocker; assigning P-high. |
Discussed with @nikomatsakis today. We agreed that there are (at least) two distinct bugs being illustrated here, as is somewhat implied in the description. I have a fix for the Oddly enough, our stdlib seems to be taking slight advantage of this bug: Which raises the question: How was/is this currently working? In the playpen, I was not able to demonstrate any actual hole in the library via this mistake; i.e. calling |
This is fixed, and has tests. |
Thanks! |
This compiles successfully, but it should error. Self is not Clone, and Noexist doesn't exist.
This gives an ICE:
The text was updated successfully, but these errors were encountered: