Skip to content

Null byte in export name causes ICE #51741

Closed
@michaelwu

Description

@michaelwu
#[export_name="\0foo"]
pub fn baz() {}

fn main () {}

outputs

   Compiling playground v0.0.1 (file:///playground)
error: internal compiler error: librustc_codegen_llvm/declare.rs:61: name "\u{0}foo" contains an interior null byte

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:554:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error


note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.28.0-nightly (cbc4c8380 2018-06-22) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

https://play.rust-lang.org/?gist=524f233321bcbb79fc6180ef95e38e96&version=nightly&mode=debug

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