-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE with a simple associated type, causing "index out of bounds" on a vector #25679
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
Comments
btw I'm not sure this should be possible, it seems like the impl would be unconstrained? |
@ebfull I believe it depends on a method. If there was an |
I believe a type is unconstrained if you cannot determine the impl from the Self. In this case, given a generic impl<T> Foo<T> {
fn present<D: Device<Resources=T>>(&self, _dev: &D) { }
} |
@ebfull huh, I stand corrected. I was thinking about how trait implementation gets chosen in a similar manner, and thought the same works for the pure struct Foo;
trait Bar<T> {
fn forget(&self, _: T) {}
}
impl<T> Bar<T> for Foo {}
fn main() {
let foo = Foo;
foo.forget(0i8);
} I guess the issue is not a blocker for us then, I'll rewrite |
It sounds like you might also want to consider just |
Backtrace:
It seems like there is something stupid going on with inference variables. |
It can introduce obligations to the fulfillment context, which would incorrectly still remain after the probe finished. Fixes rust-lang#25679.
Broken on both stable and the nightly. Affects a real use case with present() in gfx-rs.
Gives me:
The text was updated successfully, but these errors were encountered: