Skip to content

[Nightly] LLVM Assertion: SrcTy must be larger than DestTy for Trunc #41744

Description

@steffengy

Last good version: rustc 1.19.0-nightly (6a5fc9eec 2017-05-02) (previous nightly)
Version: rustc 1.19.0-nightly (2d4ed8e0c 2017-05-03)

Unfortunately I can't provide a small testcase for reproduction,
but the following works reliably:

Reproduction

EDIT: For readability the reduced example from below:

trait Tc {}
impl Tc for bool {}

fn main() {
    let _: &[&Tc] = &[&true];
}

OLD:

# You'll need openssl for the build process on linux, e.g. for ubuntu:
sudo apt-get install libssl-dev
git clone https://github.com/steffengy/tiberius -b ssl
cd tiberius && cargo test

Output:

rustc: /checkout/src/llvm/lib/IR/Constants.cpp:1568: static llvm::Constant*
 llvm::ConstantExpr::getTrunc(llvm::Constant*, llvm::Type*, bool): 
Assertion `C->getType()->getScalarSizeInBits() > Ty->getScalarSizeInBits()&& 
SrcTy must be larger than DestTy for Trunc!"' failed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions