-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 with nightly in LvalyeTy<'tcx>::protection_ty #31504
Comments
Minimal-ish reproduction: use std::marker::PhantomData;
pub trait DataBind {
type Data;
}
impl<T> DataBind for Global<T> {
type Data = T;
}
pub struct Global<T>(PhantomData<T>);
pub struct Data {
pub offsets: <Global<[f32; 1]> as DataBind>::Data,
}
pub fn main() {
let mut d = Data { offsets: [0.0] };
d.offsets[0] = 0.0;
} |
@nikomatsakis this might be more up your alley than mine. |
This is because |
Actually, normalizing will ruin regions, preventing borrowck from running (no, I don't want to run region inference each time). I guess that field expressions will have to store the normalized type. What do you think of it, @nikomatsakis? |
Nominating because regression. This issue is also visible on my MIR typeck branch. |
@nagisa thanks for composing the test case! |
Storing the normalized type seems reasonable to me as a first step, though @arielb1 I'd expect typeck to revalidate that. |
However, the problem that @arielb1 referred to of having to re-run region inference suggests that perhaps there is a reason to resurrect that old patch of mine that "extracts" regions and types rather than inferring them when doing trait matching. It would avoid the need to re-run inference, I believe. (Also, lazy normalization seems like it would help here too, of course.) |
triage: P-high (regression) |
Note that this is fixed in @arielb1's branch. |
Looks like it's fixed now, thanks! |
If this is indeed #31603, I still encounter it with latest Nightly: https://travis-ci.org/fxbox/thinkerbell/jobs/109967451 |
Fix for this didn't land yet.
|
Ok, fix confirmed: https://travis-ci.org/fxbox/thinkerbell/jobs/111150793 |
It works fine with rust-beta (1.7) and rust-stable (1.6).
Repro steps:
cargo test
), assuming you have glfw3 and X libraries installed. I'll try to narrow down the problem to a simpler case.Backtrace:
The text was updated successfully, but these errors were encountered: