]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-5439.rs
Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
[rust.git] / tests / ui / issues / issue-5439.rs
1 struct Foo {
2     foo: isize,
3 }
4
5 struct Bar {
6     bar: isize,
7 }
8
9 impl Bar {
10     fn make_foo (&self, i: isize) -> Box<Foo> {
11         return Box::new(Foo { nonexistent: self, foo: i }); //~ ERROR: no field named
12     }
13 }
14
15 fn main () {
16     let bar = Bar { bar: 1 };
17     let foo = bar.make_foo(2);
18     println!("{}", foo.foo);
19 }