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