Skip to content

LLVM assertion when creating region pointer for bare self value #5280

Description

@jdm
type FontTableTag = u32;

trait FontTableTagConversions {
  fn tag_to_str(self);
}

impl FontTableTagConversions for FontTableTag {
  fn tag_to_str(self) {
    &self;
  }
}

fn main() {
    5.tag_to_str();
}

rustc: /run/media/jdm/ssd/rust/src/llvm/lib/VMCore/Instructions.cpp:2383: static llvm::CastInst* llvm::CastInst::CreatePointerCast(llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion S->getType()->isPointerTy() && "Invalid cast"' failed.`

Activity

  1. graydon commented on Apr 30, 2013

    @graydon
    Contributor

    assigning bug; change assignment if you disagree

  2. catamorphism commented on Jun 26, 2013

    @catamorphism
    Contributor

    Reproduced with efd1438

  3. Blei commented on Jun 28, 2013

    @Blei
    Contributor

    This seems to be fixed on 887ae82 (linux 64).

  4. added a commit that references this issue on May 2, 2020
    23bd427
  5. added a commit that references this issue on Aug 21, 2026
  6. added a commit that references this issue on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-lifetimesArea: Lifetimes / regionsA-trait-systemArea: Trait systemI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions