diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2022-07-25 16:07:57 +0200 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2022-07-25 16:07:57 +0200 |
| commit | 7a3ed235eba253f573d8842549bc6418b0a2eaca (patch) | |
| tree | e3a0fd1c635273ffc3ed91b3613cb19d680358c9 /compiler/rustc_codegen_cranelift/example/std_example.rs | |
| parent | 2fdbf075cf502431ca9fee6616331b32e34f25de (diff) | |
| parent | c19edfd71a1d0ddef86c2c67fdb40718d40a72b4 (diff) | |
| download | rust-7a3ed235eba253f573d8842549bc6418b0a2eaca.tar.gz rust-7a3ed235eba253f573d8842549bc6418b0a2eaca.zip | |
Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example/std_example.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/std_example.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/std_example.rs b/compiler/rustc_codegen_cranelift/example/std_example.rs index 0a2bce2621d..0b5b6cd55d7 100644 --- a/compiler/rustc_codegen_cranelift/example/std_example.rs +++ b/compiler/rustc_codegen_cranelift/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) { |
