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

#![feature(return_position_impl_trait_in_trait)]

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;
}