Skip to content

This DST code causes an llvm assertion failure during compilation. #19064

Closed
@canndrew

Description

@canndrew

Trying to build this:

struct Foo(pub str);

impl Foo {
  fn print(&self) {
    match self {
      &Foo(ref s)  => println!("f\"{}\"", s),
    }
  }
}

fn main() {}

and I get this:

rustc: /home/shum/src/rust/rust/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::PointerType; Y = const llvm::Type; typename llvm::cast_retty<X, Y*>::ret_type = const llvm::PointerType*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DSTsArea: Dynamically-sized types (DSTs)A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions