mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
18 lines
183 B
Rust
18 lines
183 B
Rust
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()
|
|
//~^ ERROR borrow of moved value
|
|
}
|
|
|
|
fn main() {}
|