about summary refs log tree commit diff
path: root/example/std_example.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-07-25 16:07:57 +0200
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-07-25 16:07:57 +0200
commit640c3f730a998f7f5ba82ea4a2363d92064e7bc4 (patch)
treebd7fd2c6eb9d736cfbc9f72535e1a36880e04d98 /example/std_example.rs
parent745193d1971620f73bbab3a2b9391728d9210d30 (diff)
downloadrust-640c3f730a998f7f5ba82ea4a2363d92064e7bc4.tar.gz
rust-640c3f730a998f7f5ba82ea4a2363d92064e7bc4.zip
Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25
Diffstat (limited to 'example/std_example.rs')
-rw-r--r--example/std_example.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/example/std_example.rs b/example/std_example.rs
index 0a2bce2621d..0b5b6cd55d7 100644
--- a/example/std_example.rs
+++ b/example/std_example.rs
@@ -128,6 +128,25 @@ fn main() {
         0 => loop {},
         v => panic(v),
     };
+
+    if black_box(false) {
+        // Based on https://github.com/rust-lang/rust/blob/2f320a224e827b400be25966755a621779f797cc/src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs
+        let _ = Foo::<dyn Send>::new();
+
+        #[allow(dead_code)]
+        struct Foo<T: ?Sized> {
+            base: Never,
+            value: T,
+        }
+
+        impl<T: ?Sized> Foo<T> {
+            pub fn new() -> Box<Foo<T>> {
+                todo!()
+            }
+        }
+
+        enum Never {}
+    }
 }
 
 fn panic(_: u128) {