Skip to content

zero-length static array triggers LLVM assertion error on windows #13793

Closed
@klutzy

Description

@klutzy
pub static A: &'static [int] = &[];

pub fn main() {
}
Assertion failed!

Program: d:\usr\rust\bin\rustc.exe
File: c:/bot/slave/nightly-win/build/src/llvm/lib/MC/WinCOFFObjectWriter.cpp, Line 224

Expression: Section->Number != -1 && "Sections with relocations must be real!"

Original: rustc --test empty.rs triggers LLVM assertion error on windows

$ touch empty.rs
$ rustc --test empty.rs

Assertion failed!

Program: c:\home\stone\rust-vanilla\build\i686-pc-mingw32\stage2\bin\rustc.exe
File: c:/home/stone/rust-vanilla/src/llvm/lib/MC/WinCOFFObjectWriter.cpp, Line 222

Expression: Section->Number != -1 && "Sections with relocations must be real!"

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions