diff options
Diffstat (limited to 'src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs')
-rw-r--r-- | src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs b/src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs new file mode 100644 index 000000000..b3f22ecf5 --- /dev/null +++ b/src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs @@ -0,0 +1,29 @@ +// build-pass +// compile-flags: -Cdebuginfo=2 +// fixes issue #94149 + +#![allow(dead_code)] + +pub fn main() { + let _ = Foo::<dyn FooTrait>::new(); +} + +pub struct Foo<T: FooTrait + ?Sized> { + base: FooBase, + value: T, +} + +impl<T: FooTrait + ?Sized> Foo<T> { + pub fn new() -> Box<Foo<T>> { + todo!() + } +} + +pub trait FooTrait {} + +pub struct FooBase { + cls: Bar, +} + +// Bar *must* be a fieldless enum +pub enum Bar {} |