-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 in borrow checker #27480
Labels
A-borrow-checker
Area: The borrow checker
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
sfackler
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Aug 2, 2015
Could you maybe try to reduce the case down a bit more? |
Reduced: pub enum FragmentRepr {
Boxed(Box<FragmentRepr>),
Enum(Vec<FragmentRepr>),
}
fn bar() -> u32 { panic!(); }
pub fn foo(mut entry: &mut FragmentRepr) {
loop {
match bar() {
1 => {
let mut discrs = if let FragmentRepr::Enum(ref mut discrs) = *entry {
discrs
} else {
return;
};
entry = &mut discrs[0];
}
_ => {
entry = if let FragmentRepr::Boxed(ref mut contents) = *entry {
contents
} else {
return;
};
}
}
}
}
fn main() {} |
Much reduced: pub enum FragmentRepr {
Boxed(Box<FragmentRepr>),
Enum(()),
}
fn unconstrained<T>() -> T { loop {} }
pub fn foo(mut entry: &mut FragmentRepr) {
entry = if let &mut FragmentRepr::Boxed(ref mut contents) = entry {
contents
} else {
unconstrained()
};
match *entry {
FragmentRepr::Enum(ref mut discrs) => {},
_ => {}
};
}
fn main() {} Somehow Seems like we don't handle deref-coercions somewhere. |
Closed
duplicate of #27844. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-borrow-checker
Area: The borrow checker
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
https://play.rust-lang.org/?gist=23de822c03921663ae66&version=nightly .
Error message:
The text was updated successfully, but these errors were encountered: