]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-5439.rs
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_clif-2021-03-29
[rust.git] / src / test / ui / issues / issue-5439.rs
1 #![feature(box_syntax)]
2
3 struct Foo {
4     foo: isize,
5 }
6
7 struct Bar {
8     bar: isize,
9 }
10
11 impl Bar {
12     fn make_foo (&self, i: isize) -> Box<Foo> {
13         return box Foo { nonexistent: self, foo: i }; //~ ERROR: no field named
14     }
15 }
16
17 fn main () {
18     let bar = Bar { bar: 1 };
19     let foo = bar.make_foo(2);
20     println!("{}", foo.foo);
21 }