-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rust 1.18: internal compiler error: unresolved type in dtorck #42552
Comments
for reference, this was an error in 1.17.0, but didn't hit an ICE:
|
I constructed this example from a more complex one which I am not able to post here (too many requirements). The original piece of code compiled fine under 1.17, but hits an ICE in 1.18. Can I somehow downgrade to 1.17 on my machine to construct an example that compiles cleanly under 1.17 but fails in 1.18? |
@phimuemue if you're using rustup, |
I've bisected this to 141e8a6 -- #41716 (cc @nikomatsakis ) but I think P-medium since, while a regression, the code didn't compile anyway. |
The following code compiles fine under 1.17, but yields the aforementioned ICE under 1.18:
|
Okay, in that case P-high, I think. |
Reduced from @phimuemue's second example. Compiles fine on 1.17, ICE on 1.18 with "unresolved type in dtorck". fn into_iter<I: Iterator>(a: &I) -> Groups<I> {
Groups { _a: a }
}
pub struct Groups<'a, I: 'a> {
_a: &'a I,
}
impl<'a, I: Iterator> Iterator for Groups<'a, I> {
type Item = Group<'a, I>;
fn next(&mut self) -> Option<Self::Item> {
None
}
}
pub struct Group<'a, I: Iterator + 'a>
where I::Item: 'a // <-- needed to trigger ICE!
{
_phantom: &'a (),
_ice_trigger: I::Item, // <-- needed to trigger ICE!
}
fn main() {
let _ = into_iter(&[0].iter().map(|_| 0)).map(|grp| {
let _g = grp;
});
} |
Referring to my example, ICE happens due to Logs of relevant function before the crash (I've upgraded all relevant
Real stack trace
ICE does not happen if the
(removing the Similarly @phimuemue's second example does not ICE after replacing all |
Will investigate. |
OK, I've tracked down this bug, more-or-less, but I'm not sure how best to fix it just now. What seems to be happening:
Definitely the behavior of |
rust-1.18-bug.zip
Cargo.toml:
main.rs:
cargo build
results in:rustc --version --verbose
yields (I'm running Ubuntu 16.04):Backtrace:
The text was updated successfully, but these errors were encountered: