about summary refs log tree commit diff
path: root/tests/ui/delegation/impl-trait.rs
blob: 13df0155485c9b1d050361fd0270e41ea60e3148 (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
//@ check-pass

#![feature(fn_delegation)]
#![allow(incomplete_features)]

mod to_reuse {
    pub fn foo() -> impl Clone { 0 }
}

reuse to_reuse::foo;

trait Trait {
    fn bar() -> impl Clone { 1 }
}

struct S;
impl Trait for S {}

impl S {
    reuse to_reuse::foo;
    reuse <S as Trait>::bar;
}

fn main() {
    foo().clone();
    <S>::bar().clone();
}