]> git.lizzy.rs Git - rust.git/blob - tests/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / ui / debuginfo / debuginfo_with_uninhabitable_field_and_unsized.rs
1 // build-pass
2 // compile-flags: -Cdebuginfo=2
3 // fixes issue #94149
4
5 #![allow(dead_code)]
6
7 pub fn main() {
8     let _ = Foo::<dyn FooTrait>::new();
9 }
10
11 pub struct Foo<T: FooTrait + ?Sized> {
12     base: FooBase,
13     value: T,
14 }
15
16 impl<T: FooTrait + ?Sized> Foo<T> {
17     pub fn new() -> Box<Foo<T>> {
18         todo!()
19     }
20 }
21
22 pub trait FooTrait {}
23
24 pub struct FooBase {
25     cls: Bar,
26 }
27
28 // Bar *must* be a fieldless enum
29 pub enum Bar {}