Skip to content

Naked EII impl functions are currently not working #158293

Description

@boozook

Naked functions as eii-impl are not work.

  • without default impl — error: impl not found
  • with default impl — used default impl instead of external impl, without errors by rustc or linker

Reproducible examples

Without default impl:

#[eii(requires_impl)]
unsafe extern "C" fn entry_eh(_: usize);


#[crate::requires_impl]
#[unsafe(naked)]
unsafe extern "C" fn eh(_: usize) { core::arch::naked_asm!("nop"); }

With default impl:

#[eii(opt_impl)]
unsafe extern "C" fn entry_eh(_: usize) { println!("called default") }


#[crate::opt_impl]
#[unsafe(naked)]
unsafe extern "C" fn eh(_: usize) { core::arch::naked_asm!("nop"); }

Expected

I hope it's possible to have naked impls, but as explained there (comment) — may not be possible, so I expecting proper errors.

I'd expect error with some explanation in case of default impl;
and error with explanation better then "just not found" in case without default impl.

Meta

rustc --version --verbose:

rustc 1.98.0-nightly (8b6558a02 2026-06-20)
binary: rustc
commit-hash: 8b6558a02b2774acfb25cf15e199467c37ba7490
commit-date: 2026-06-20
host: aarch64-apple-darwin
release: 1.98.0-nightly
LLVM version: 22.1.7

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.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