Skip to content

MIR: Translation of fat ptr constvals is incorrect #30479

Closed
@luqmana

Description

@luqmana

Seems like fat ptrs aren't handled properly in mir::constant::trans_constval:

#![feature(rustc_attrs)]

#[rustc_mir]
fn test() -> &'static str {
    "sad"
}

fn main() {}
rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/IR/Constants.cpp:1649: static llvm::Constant* llvm::ConstantExpr::getPointerCast(llvm::Constant*, llvm::Type*): Assertion `S->getType()->isPtrOrPtrVectorTy() && "Invalid cast"' failed.
Aborted (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions