about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/errors.rs
diff options
context:
space:
mode:
authorFolkert <folkert@folkertdev.nl>2024-07-17 10:42:24 +0200
committerFolkert <folkert@folkertdev.nl>2024-07-27 12:55:39 +0200
commitc6a166bac269eda77b595fdc8ff7290e1372c147 (patch)
tree46b7764813f597d7df6c2de3e89bb8a319b3ed24 /compiler/rustc_passes/src/errors.rs
parent4d082b77af1f714df6c407785e1961a9dddd554c (diff)
downloadrust-c6a166bac269eda77b595fdc8ff7290e1372c147.tar.gz
rust-c6a166bac269eda77b595fdc8ff7290e1372c147.zip
switch to an allowlist approach
- merge error codes
- use attribute name that is incompatible in error message
- add test for conditional incompatible attribute
- add `linkage` to the allowlist
Diffstat (limited to 'compiler/rustc_passes/src/errors.rs')
-rw-r--r--compiler/rustc_passes/src/errors.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs
index b6be096b43b..b195ba973ce 100644
--- a/compiler/rustc_passes/src/errors.rs
+++ b/compiler/rustc_passes/src/errors.rs
@@ -1183,13 +1183,14 @@ pub struct NakedFunctionsMustUseNoreturn {
 }
 
 #[derive(Diagnostic)]
-#[diag(passes_naked_functions_codegen_attribute, code = E0736)]
-pub struct NakedFunctionCodegenAttribute {
+#[diag(passes_naked_functions_incompatible_attribute, code = E0736)]
+pub struct NakedFunctionIncompatibleAttribute {
     #[primary_span]
     #[label]
     pub span: Span,
     #[label(passes_naked_attribute)]
     pub naked_span: Span,
+    pub attr: Symbol,
 }
 
 #[derive(Diagnostic)]