allow #[rustc_std_internal_symbol] in combination with #[naked]

This commit is contained in:
Folkert de Vries
2025-05-01 16:19:24 +02:00
parent 6e23095adf
commit 5d308148aa
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -625,6 +625,7 @@ fn check_naked(
sym::naked,
sym::instruction_set,
sym::repr,
sym::rustc_std_internal_symbol,
// code generation
sym::cold,
// documentation
+7 -1
View File
@@ -2,7 +2,7 @@
//@ ignore-nvptx64
//@ ignore-spirv
#![feature(asm_unwind, linkage)]
#![feature(asm_unwind, linkage, rustc_attrs)]
#![crate_type = "lib"]
use std::arch::{asm, naked_asm};
@@ -225,3 +225,9 @@ pub extern "C" fn compatible_doc_attributes() {
pub extern "C" fn compatible_linkage() {
naked_asm!("", options(raw));
}
#[rustc_std_internal_symbol]
#[unsafe(naked)]
pub extern "C" fn rustc_std_internal_symbol() {
naked_asm!("", options(raw));
}