Skip to content

rustc crash for unreachable io loop #5741

Closed
@ramonsnir

Description

@ramonsnir

The following sample crashed rustc:

fn main() {
    return;
    while io::stdin().read_line() != ~"quit" { };
}

Removing the return;, or unwrapping the while (leaving only io::stdin().read_line() != ~"quit";), or replacing the predicate (leaving while 2 != 3 { };), solves the crash.

Reproduced on Windows 64-bit, Fedora 32-bit, Ubuntu 64-bit.

Full crash log (thanks to dbaupp) @ https://gist.github.com/dbaupp/5318920
Short crash message:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    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