rust/tests/ui/issues/issue-5439.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
323 B
Rust
Raw Normal View History

struct Foo {
foo: isize,
}
struct Bar {
bar: isize,
}
impl Bar {
fn make_foo (&self, i: isize) -> Box<Foo> {
return Box::new(Foo { nonexistent: self, foo: i }); //~ ERROR: no field named
}
}
fn main () {
let bar = Bar { bar: 1 };
let foo = bar.make_foo(2);
2013-09-30 03:06:21 +00:00
println!("{}", foo.foo);
}