-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Instruction does not dominate all uses
LLVM error in a pattern match with a ref pattern and dereference of a box
#15892
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
Labels
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
Instruction does not dominate all uses
error with a pattern match with a ref pattern and redeferencing a boxInstruction does not dominate all uses
error with a pattern match, ref patterns and dereferencing a box
Instruction does not dominate all uses
error with a pattern match, ref patterns and dereferencing a boxInstruction does not dominate all uses
LLVM error in a pattern match with a ref pattern and dereferencing a box
Instruction does not dominate all uses
LLVM error in a pattern match with a ref pattern and dereferencing a boxInstruction does not dominate all uses
LLVM error in a pattern match with a ref pattern and dereference of a box
On a related note (I think) This works: fn tail(&self) -> LinkedList {
match *self {
Cons(_, ref l) => {
*l.clone()
},
_ => fail!("called `tail` on Empty"),
}
} But this doesn't with the same LLVM error. fn tail(&self) -> LinkedList {
match *self {
Cons(_, ref l) => *l.clone(),
_ => fail!("called `tail` on Empty"),
}
}
|
cc @luqmana |
It's very subtle. The following ICEs: #[deriving(Clone)]
enum LinkedList { Cons(Box<uint>), Nil }
impl LinkedList {
fn tail(self) -> uint {
match self {
Nil => 1u,
Cons(l) => *l.clone()
}
}
}
fn main() { } But this is okay: #[deriving(Clone)]
enum LinkedList { Cons(Box<uint>), Nil }
impl LinkedList {
fn tail(self) -> uint {
match self {
Nil => 1u,
Cons(l) => (*l.clone()) // Notice the extra parens.
}
}
}
fn main() { } |
Seems specific to |
#18845 is a dup that has a smaller test case, so I'm giving this a close in favor of that. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The functions below are OK:
but:
produces a LLVM ERROR. The message is:
I'm sorry if it isn't a minimum example of this issue.
The text was updated successfully, but these errors were encountered: