about summary refs log tree commit diff
path: root/tests/ui/impl-trait/in-trait/object-safety-sized.rs
blob: 2bd8ea646a18a6d011fcbbe1cbb0d7441f5fc1dc (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;
}