]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/closure-move-spans.rs
Rollup merge of #103146 - joboet:cleanup_pthread_condvar, r=Mark-Simulacrum
[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 fn move_after_move(x: String) {
4     || x;
5     let y = x; //~ ERROR
6 }
7
8 fn borrow_after_move(x: String) {
9     || x;
10     let y = &x; //~ ERROR
11 }
12
13 fn borrow_mut_after_move(mut x: String) {
14     || x;
15     let y = &mut x; //~ ERROR
16 }
17
18 fn fn_ref<F: Fn()>(f: F) -> F { f }
19 fn fn_mut<F: FnMut()>(f: F) -> F { f }
20
21 fn main() {}