From 6ca5ec7b4ef0466a1cdf3fbce9212cabc171d21a Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Tue, 10 Sep 2024 14:42:17 +0200 Subject: disallow `naked_asm!` outside of `#[naked]` functions --- compiler/rustc_passes/src/errors.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'compiler/rustc_passes/src/errors.rs') diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index f5d982e1a5c..a985ecb019a 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -1221,6 +1221,13 @@ pub(crate) struct NakedFunctionIncompatibleAttribute { pub attr: Symbol, } +#[derive(Diagnostic)] +#[diag(passes_naked_asm_outside_naked_fn)] +pub(crate) struct NakedAsmOutsideNakedFn { + #[primary_span] + pub span: Span, +} + #[derive(Diagnostic)] #[diag(passes_attr_only_in_functions)] pub(crate) struct AttrOnlyInFunctions { -- cgit 1.4.1-3-g733a5