mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
allow #[rustfmt::skip] in combination with #[naked]
This commit is contained in:
@@ -683,7 +683,9 @@ fn check_naked(
|
||||
}
|
||||
}
|
||||
|
||||
if !other_attr.has_any_name(ALLOW_LIST) {
|
||||
if !other_attr.has_any_name(ALLOW_LIST)
|
||||
&& !matches!(other_attr.path().as_slice(), [sym::rustfmt, ..])
|
||||
{
|
||||
let path = other_attr.path();
|
||||
let path: Vec<_> = path.iter().map(|s| s.as_str()).collect();
|
||||
let other_attr_name = path.join("::");
|
||||
|
||||
@@ -231,3 +231,9 @@ pub extern "C" fn compatible_linkage() {
|
||||
pub extern "C" fn rustc_std_internal_symbol() {
|
||||
naked_asm!("", options(raw));
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[unsafe(naked)]
|
||||
pub extern "C" fn rustfmt_skip() {
|
||||
naked_asm!("", options(raw));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user