Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRust 1.18: internal compiler error: unresolved type in dtorck #42552
Comments
This comment has been minimized.
This comment has been minimized.
|
for reference, this was an error in 1.17.0, but didn't hit an ICE:
|
frewsxcv
added
the
I-ICE
label
Jun 8, 2017
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
@phimuemue if you're using rustup, |
Mark-Simulacrum
added
the
regression-from-stable-to-stable
label
Jun 8, 2017
This comment has been minimized.
This comment has been minimized.
|
I've bisected this to 141e8a6 -- #41716 (cc @nikomatsakis ) but I think P-medium since, while a regression, the code didn't compile anyway. |
Mark-Simulacrum
added
the
P-medium
label
Jun 8, 2017
This comment has been minimized.
This comment has been minimized.
|
The following code compiles fine under 1.17, but yields the aforementioned ICE under 1.18:
|
This comment has been minimized.
This comment has been minimized.
|
Okay, in that case P-high, I think. |
Mark-Simulacrum
added
P-high
and removed
P-medium
labels
Jun 8, 2017
This comment has been minimized.
This comment has been minimized.
|
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;
});
} |
This comment has been minimized.
This comment has been minimized.
|
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 |
TimNN
added
the
T-compiler
label
Jun 9, 2017
This comment has been minimized.
This comment has been minimized.
|
Will investigate. |
nikomatsakis
self-assigned this
Jun 9, 2017
nikomatsakis
referenced this issue
Jun 13, 2017
Closed
Type inference regression in rustc 1.18 #42545
This comment has been minimized.
This comment has been minimized.
|
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 |
phimuemue commentedJun 8, 2017
rust-1.18-bug.zip
Cargo.toml:
main.rs:
cargo buildresults in:rustc --version --verboseyields (I'm running Ubuntu 16.04):Backtrace: