summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-5439.rs
blob: cd039506f381642f8fcdcc1d63f06d10fa406b50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(box_syntax)]

struct Foo {
    foo: isize,
}

struct Bar {
    bar: isize,
}

impl Bar {
    fn make_foo (&self, i: isize) -> Box<Foo> {
        return box Foo { nonexistent: self, foo: i }; //~ ERROR: no field named
    }
}

fn main () {
    let bar = Bar { bar: 1 };
    let foo = bar.make_foo(2);
    println!("{}", foo.foo);
}