]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-5439.rs
New upstream version 1.60.0+dfsg1
[rustc.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 }