summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-27240.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-27240.rs')
-rw-r--r--tests/ui/issues/issue-27240.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-27240.rs b/tests/ui/issues/issue-27240.rs
new file mode 100644
index 000000000..eaf254f33
--- /dev/null
+++ b/tests/ui/issues/issue-27240.rs
@@ -0,0 +1,27 @@
+// run-pass
+#![allow(unused_assignments)]
+#![allow(unused_variables)]
+use std::fmt;
+struct NoisyDrop<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] T);
+impl<T: fmt::Debug> Drop for NoisyDrop<T> {
+ fn drop(&mut self) {}
+}
+
+struct Bar<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] [*const NoisyDrop<T>; 2]);
+
+fn fine() {
+ let (u,b);
+ u = vec![43];
+ b = Bar([&NoisyDrop(&u), &NoisyDrop(&u)]);
+}
+
+#[allow(unused_tuple_struct_fields)]
+struct Bar2<T: fmt::Debug>(*const NoisyDrop<T>, *const NoisyDrop<T>);
+
+fn lolwut() {
+ let (u,v);
+ u = vec![43];
+ v = Bar2(&NoisyDrop(&u), &NoisyDrop(&u));
+}
+
+fn main() { fine(); lolwut() }