aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/pin_project/packed-name-value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pin_project/packed-name-value.rs')
-rw-r--r--tests/ui/pin_project/packed-name-value.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/ui/pin_project/packed-name-value.rs b/tests/ui/pin_project/packed-name-value.rs
index ed819ca..dedc403 100644
--- a/tests/ui/pin_project/packed-name-value.rs
+++ b/tests/ui/pin_project/packed-name-value.rs
@@ -1,17 +1,24 @@
use pin_project::pin_project;
-#[repr(packed = "")] //~ ERROR E0552
-struct S1 {
- f: (),
-}
+// #[repr(packed = "")] is not valid format of #[repr(packed)] and will be
+// rejected by rustc.
+// However, we should not rely on the behavior of rustc that rejects this.
+// https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001
+
+// https://github.com/taiki-e/pin-project/pull/324#discussion_r612388001
+// https://github.com/rust-lang/rust/issues/83921
+// #[repr(packed = "")] //~ ERROR E0552
+// struct S1 {
+// f: (),
+// }
#[pin_project]
-#[repr(packed = "")] //~ ERROR E0552
+#[repr(packed = "")] //~ ERROR attribute should not be name-value pair
struct S2 {
f: (),
}
-#[repr(packed = "")] //~ ERROR E0552
+#[repr(packed = "")] //~ ERROR attribute should not be name-value pair
#[pin_project]
struct S3 {
f: (),