summaryrefslogtreecommitdiffstats
path: root/src/test/ui/debuginfo/debuginfo_with_uninhabitable_field_and_unsized.rs
blob: b3f22ecf5115ea4ff6e06973ae7067eca67036ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 {}