]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/closure-move-spans.rs
Rollup merge of #60685 - dtolnay:spdx, r=nikomatsakis
[rust.git] / src / test / ui / nll / closure-move-spans.rs
1 // check that moves due to a closure capture give a special note
2
3 #![feature(nll)]
4
5 fn move_after_move(x: String) {
6     || x;
7     let y = x; //~ ERROR
8 }
9
10 fn borrow_after_move(x: String) {
11     || x;
12     let y = &x; //~ ERROR
13 }
14
15 fn borrow_mut_after_move(mut x: String) {
16     || x;
17     let y = &mut x; //~ ERROR
18 }
19
20 fn fn_ref<F: Fn()>(f: F) -> F { f }
21 fn fn_mut<F: FnMut()>(f: F) -> F { f }
22
23 fn main() {}