Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5d30814

Browse files
committed
allow #[rustc_std_internal_symbol] in combination with #[naked]
1 parent 6e23095 commit 5d30814

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

compiler/rustc_passes/src/check_attr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
625625
sym::naked,
626626
sym::instruction_set,
627627
sym::repr,
628+
sym::rustc_std_internal_symbol,
628629
// code generation
629630
sym::cold,
630631
// documentation

tests/ui/asm/naked-functions.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ ignore-nvptx64
33
//@ ignore-spirv
44

5-
#![feature(asm_unwind, linkage)]
5+
#![feature(asm_unwind, linkage, rustc_attrs)]
66
#![crate_type = "lib"]
77

88
use std::arch::{asm, naked_asm};
@@ -225,3 +225,9 @@ pub extern "C" fn compatible_doc_attributes() {
225225
pub extern "C" fn compatible_linkage() {
226226
naked_asm!("", options(raw));
227227
}
228+
229+
#[rustc_std_internal_symbol]
230+
#[unsafe(naked)]
231+
pub extern "C" fn rustc_std_internal_symbol() {
232+
naked_asm!("", options(raw));
233+
}

0 commit comments

Comments
 (0)