rust/tests/ui/nll/issue-52669.rs

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

18 lines
183 B
Rust
Raw Normal View History

struct A {
b: B,
}
#[derive(Clone)]
struct B;
fn foo(_: A) {}
fn bar(mut a: A) -> B {
a.b = B;
foo(a);
a.b.clone()
2018-11-27 17:56:36 +08:00
//~^ ERROR borrow of moved value
}
fn main() {}