summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-26709.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-26709.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-26709.rs b/src/test/ui/issues/issue-26709.rs
new file mode 100644
index 000000000..1bd2651dd
--- /dev/null
+++ b/src/test/ui/issues/issue-26709.rs
@@ -0,0 +1,17 @@
+// run-pass
+struct Wrapper<'a, T: ?Sized>(&'a mut i32, #[allow(unused_tuple_struct_fields)] T);
+
+impl<'a, T: ?Sized> Drop for Wrapper<'a, T> {
+ fn drop(&mut self) {
+ *self.0 = 432;
+ }
+}
+
+fn main() {
+ let mut x = 0;
+ {
+ let wrapper = Box::new(Wrapper(&mut x, 123));
+ let _: Box<Wrapper<dyn Send>> = wrapper;
+ }
+ assert_eq!(432, x)
+}