about summary refs log tree commit diff
path: root/tests/ui/attributes/malformed-static-align.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/attributes/malformed-static-align.rs')
-rw-r--r--tests/ui/attributes/malformed-static-align.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/attributes/malformed-static-align.rs b/tests/ui/attributes/malformed-static-align.rs
new file mode 100644
index 00000000000..305d8acf8af
--- /dev/null
+++ b/tests/ui/attributes/malformed-static-align.rs
@@ -0,0 +1,17 @@
+#![feature(static_align)]
+#![crate_type = "lib"]
+
+#[rustc_align_static = 16] //~ ERROR malformed `rustc_align_static` attribute input
+static S1: () = ();
+
+#[rustc_align_static("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer
+static S2: () = ();
+
+#[rustc_align_static(0)] //~ ERROR invalid alignment value: not a power of two
+static S3: () = ();
+
+#[repr(align(16))] //~ ERROR `#[repr(align(...))]` is not supported on static
+static S4: () = ();
+
+#[rustc_align_static(16)] //~ ERROR `#[rustc_align_static]` attribute cannot be used on structs
+struct Struct1;