Skip to content

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

Closed

Description

@honzasp

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)

Activity

  1. huonw commented on Jun 15, 2013

    @huonw
    Contributor

    Looks similar to #6717 and #5882.

  2. DaGenix commented on Jun 16, 2013

    @DaGenix

    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() {
    }
  3. thestinger commented on Jun 23, 2013

    @thestinger
    Contributor

    Fixed by #7214.

  4. added a commit that references this issue on Aug 12, 2021
  5. added a commit that references this issue on Aug 21, 2026
  6. added a commit that references this issue on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions