about summary refs log tree commit diff
path: root/tests/ui/delegation/method-call-choice.rs
blob: 8d53d8bfdb72da34bed804419222eac7676a4f1d (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
#![feature(fn_delegation)]
#![allow(incomplete_features)]

trait Trait {
    fn foo(&self) {}
}

struct F;
impl Trait for F {}
struct S(F);

pub mod to_reuse {
    use crate::F;

    pub fn foo(_: &F) {}
}

impl Trait for S {
    // Make sure that the method call is not generated if the path resolution
    // does not have a `self` parameter.
    reuse to_reuse::foo { self.0 }
    //~^ ERROR mismatched types
}

fn main() {}