Skip to content
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

LLVM assertion failed: "Invalid GetElementPtrInst indices for type!" #7153

Closed
honzasp opened this issue Jun 15, 2013 · 3 comments
Closed

LLVM assertion failed: "Invalid GetElementPtrInst indices for type!" #7153

honzasp opened this issue Jun 15, 2013 · 3 comments

Comments

@honzasp
Copy link

honzasp commented Jun 15, 2013

Hi,

rustc fails to compile this program:

trait TheTrait { }
struct TheStruct(~TheTrait);

fn new() -> TheStruct {
  fail!()
}

fn main() {
  ~new();
}

with

$ rustc --version
rustc 0.6 (a198aad 2013-06-13 03:25:11 -0700)
host: i686-unknown-linux-gnu

$ rustc usage.rs
rustc: (path to my rust build)/src/llvm/include/llvm/IR/Instructions.h:704: llvm::Type* llvm::checkGEPType(llvm::Type*): Assertion `Ty && "Invalid GetElementPtrInst indices for type!"' failed.
Aborted (core dumped)
@huonw
Copy link
Member

huonw commented Jun 15, 2013

Looks similar to #6717 and #5882.

@DaGenix
Copy link

DaGenix commented Jun 16, 2013

I'm hitting this same assertion with eac0200 (6/15/2013) and the following program:

trait Printable {
        fn print(&self);
}

fn test(o: &[~Printable]) {
        for o.each |&p| {
                p.print();
        }
}

fn main() {
}

bors added a commit that referenced this issue Jun 22, 2013
This finishes the incomplete conversion of unique traits as two-word
allocations started in 211d038.

Fixes #5882, #6717, #7153, #7208.
@thestinger
Copy link
Contributor

Fixed by #7214.

flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 12, 2021
Add xor case to `manual swap` lint

Continue of rust-lang#7153
closes rust-lang#6598

changelog: Add "xor swap" case to [`manual_swap`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants