summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/in-trait/object-safety-sized.rs
blob: 1a23493a94d6ba7fe7532bac53d80e9a1865b411 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// check-pass
// revisions: current next
//[next] compile-flags: -Znext-solver


fn main() {
    let vec: Vec<Box<dyn Trait>> = Vec::new();

    for i in vec {
        i.fn_2();
    }
}

trait OtherTrait {}

trait Trait {
    fn fn_1(&self) -> impl OtherTrait
    where
        Self: Sized;

    fn fn_2(&self) -> bool;
}