Skip to content

mem::transmute to nevertype causes Illigal instruction #51005

Closed
@DutchGhost

Description

@DutchGhost

transmuting to the never type causes an Illigal instruction: https://play.rust-lang.org/?gist=390b8739cfe0e25504f0602dcf546e7b&version=nightly&mode=release

#![feature(never_type)]

use std::mem;

fn main() {
    let _: ! = unsafe { mem::transmute( {} ) };
}

Now, it's true that this requires unsafe, and might not even considered an issue or bug, and probably never happens in real productions code. However, many transmutes give a segfault when done wrong, this instead gives an illigal instruction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions