diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-5439.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-5439.rs b/src/test/ui/issues/issue-5439.rs new file mode 100644 index 000000000..cd039506f --- /dev/null +++ b/src/test/ui/issues/issue-5439.rs @@ -0,0 +1,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); +} |