Skip to content

Static EII defaults are currently unsupported on macOS #157649

@AsakuraMizu

Description

@AsakuraMizu

Static EII defaults currently fail to link on macOS targets.

Example:

#![feature(extern_item_impls)]

#[eii(eii1)]
pub static DECL1: u64 = 5;

fn main() {
    println!("{DECL1}");
}

This appears to be caused by LLVM's Mach-O alias emission. See #156583 (comment) for details and links to the related LLVM issue / PR.

Until the LLVM fix reaches rustc, rustc should reject static EII defaults on macOS targets with a diagnostic that points here.

This issue tracks that temporary restriction and its eventual removal.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesF-extern_item_impls`#![feature(extern_item_impls)]`O-macosOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions