aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/cfg/packed_sneaky-span-issue-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/cfg/packed_sneaky-span-issue-2.rs')
-rw-r--r--tests/ui/cfg/packed_sneaky-span-issue-2.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/cfg/packed_sneaky-span-issue-2.rs b/tests/ui/cfg/packed_sneaky-span-issue-2.rs
new file mode 100644
index 0000000..aa65d33
--- /dev/null
+++ b/tests/ui/cfg/packed_sneaky-span-issue-2.rs
@@ -0,0 +1,18 @@
+use auxiliary_macros::hidden_repr;
+use pin_project::pin_project;
+
+//~ ERROR may not be used on #[repr(packed)] types
+// span is lost.
+// Refs: https://github.com/rust-lang/rust/issues/43081
+#[pin_project]
+#[hidden_repr(packed)]
+struct Foo {
+ #[cfg(any())]
+ #[pin]
+ field: u32,
+ #[cfg(not(any()))]
+ #[pin]
+ field: u8,
+}
+
+fn main() {}