Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

LLVM Assertion: Both operands to ICmp instruction are not of the same type! #23311

Closed
seanmonstar opened this issue Mar 12, 2015 · 5 comments
Closed
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@seanmonstar
Copy link
Contributor

Unfortunately, I don't know what in hyper is causing this error.

rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/include/llvm/IR/Instructions.h:997: void llvm::ICmpInst::AssertOK(): Assertion `getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"' failed.
@seanmonstar
Copy link
Contributor Author

Nevermind, I found it. Using an array pattern in a match against a slice:

fn main() {
    match "foo".as_bytes() {
        b"food" => println!("nom nom"),
        [b'f', ..] => println!("f!"),
        _ => ()
    }
}

@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 17, 2015
eefriedman added a commit to eefriedman/rust that referenced this issue Jul 15, 2015
The old code was not well structured, difficult to understand,
and buggy.

The new implementation is completely naive, so there may be a slight
runtime performance loss. That said, adding optimizations on top of
a clear and correct implementation seems easier than trying to
fix the old mess.

Fixes issue rust-lang#19064.
Fixes issue rust-lang#26989.
Fixes issue rust-lang#26251.
Fixes issue rust-lang#18060.
Fixes issue rust-lang#24875.
Fixes issue rust-lang#23311.
Fixes issue rust-lang#20046.
@frewsxcv
Copy link
Member

Visiting for triage: this is still an issue

@bltavares
Copy link
Contributor

Still ICE. Updated minimal test case:

#![feature(slice_patterns)]

fn main() {
    match "foo".as_bytes() {
        b"food" => println!("nom nom"),
        [b'f', ..] => println!("f!"),
        _ => ()
    }
}

bltavares added a commit to bltavares/glacier that referenced this issue Oct 31, 2015
@bluss
Copy link
Member

bluss commented Jan 8, 2017

Does not ICE anymore

@arielb1 arielb1 added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jan 9, 2017
@frewsxcv
Copy link
Member

Fixed by #40296

steveklabnik added a commit to rust-lang/glacier that referenced this issue Apr 23, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants