summaryrefslogtreecommitdiffstats
path: root/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs
blob: b5f13959081b819beedc989d77176ff98cd74378 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
struct Foo {
    field: u32,
}

impl Foo {
    fn field(&self) -> u32 {
        self.field
    }

    fn new() -> Foo {
        field; //~ ERROR cannot find value `field` in this scope
        Foo { field } //~ ERROR cannot find value `field` in this scope
    }
    fn clone(&self) -> Foo {
        Foo { field } //~ ERROR cannot find value `field` in this scope
    }
}
fn main() {}