summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/in-trait/issue-102140.rs
blob: be1e012acb185b756c8efdfe0834db9af299b290 (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
30
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]

trait Marker {}
impl Marker for u32 {}

trait MyTrait {
    fn foo(&self) -> impl Marker
    where
        Self: Sized;
}

struct Outer;

impl MyTrait for Outer {
    fn foo(&self) -> impl Marker {
        42
    }
}

impl dyn MyTrait {
    fn other(&self) -> impl Marker {
        MyTrait::foo(&self)
        //~^ ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
        //~| ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
        //~| ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
    }
}

fn main() {}