rust/tests/ui/borrowck/borrowck-move-in-irrefut-pat.rs
2023-01-11 09:32:08 +00:00

17 lines
254 B
Rust

fn with<F>(f: F) where F: FnOnce(&String) {}
fn arg_item(&_x: &String) {}
//~^ ERROR [E0507]
fn arg_closure() {
with(|&_x| ())
//~^ ERROR [E0507]
}
fn let_pat() {
let &_x = &"hi".to_string();
//~^ ERROR [E0507]
}
pub fn main() {}