summary refs log tree commit diff
path: root/compiler/rustc_passes/src/errors.rs
diff options
context:
space:
mode:
authorFolkert de Vries <folkert@folkertdev.nl>2025-06-09 20:08:52 +0200
committerFolkert de Vries <folkert@folkertdev.nl>2025-06-18 12:37:08 +0200
commit1fdf2b562070ec98c5b32ee67b8c6d8145127a6e (patch)
treeb03e6e19001df8984537f2843f246c8453c1bcf6 /compiler/rustc_passes/src/errors.rs
parent1bb335244c311a07cee165c28c553c869e6f64a9 (diff)
downloadrust-1fdf2b562070ec98c5b32ee67b8c6d8145127a6e.tar.gz
rust-1fdf2b562070ec98c5b32ee67b8c6d8145127a6e.zip
add `#[align]` attribute
Right now it's used for functions with `fn_align`, in the future it will
get more uses (statics, struct fields, etc.)
Diffstat (limited to 'compiler/rustc_passes/src/errors.rs')
-rw-r--r--compiler/rustc_passes/src/errors.rs30
1 files changed, 23 insertions, 7 deletions
diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs
index f0d4b610f63..587d9170f06 100644
--- a/compiler/rustc_passes/src/errors.rs
+++ b/compiler/rustc_passes/src/errors.rs
@@ -1308,13 +1308,6 @@ pub(crate) enum AttrApplication {
         #[label]
         span: Span,
     },
-    #[diag(passes_attr_application_struct_enum_function_method_union, code = E0517)]
-    StructEnumFunctionMethodUnion {
-        #[primary_span]
-        hint_span: Span,
-        #[label]
-        span: Span,
-    },
 }
 
 #[derive(Diagnostic)]
@@ -1816,3 +1809,26 @@ pub(crate) enum UnexportableItem<'a> {
         field_name: &'a str,
     },
 }
+
+#[derive(Diagnostic)]
+#[diag(passes_repr_align_should_be_align)]
+pub(crate) struct ReprAlignShouldBeAlign {
+    #[primary_span]
+    #[help]
+    pub span: Span,
+    pub item: &'static str,
+}
+
+#[derive(Diagnostic)]
+#[diag(passes_align_should_be_repr_align)]
+pub(crate) struct AlignShouldBeReprAlign {
+    #[primary_span]
+    #[suggestion(
+        style = "verbose",
+        applicability = "machine-applicable",
+        code = "#[repr(align({align_bytes}))]"
+    )]
+    pub span: Span,
+    pub item: &'static str,
+    pub align_bytes: u64,
+}