2017-10-04 06:29:55 -05:00
|
|
|
// revisions: ast mir
|
2017-11-19 16:37:59 -06:00
|
|
|
//[mir]compile-flags: -Z borrowck=mir
|
2017-10-04 06:29:55 -05:00
|
|
|
|
2015-01-03 09:45:00 -06:00
|
|
|
fn with<F>(f: F) where F: FnOnce(&String) {}
|
2013-06-20 14:11:47 -05:00
|
|
|
|
2014-05-22 18:57:53 -05:00
|
|
|
fn arg_item(&_x: &String) {}
|
2017-10-04 06:29:55 -05:00
|
|
|
//[ast]~^ ERROR cannot move out of borrowed content [E0507]
|
2017-11-19 16:37:59 -06:00
|
|
|
//[mir]~^^ ERROR [E0507]
|
2013-06-20 14:11:47 -05:00
|
|
|
|
|
|
|
fn arg_closure() {
|
|
|
|
with(|&_x| ())
|
2017-10-04 06:29:55 -05:00
|
|
|
//[ast]~^ ERROR cannot move out of borrowed content [E0507]
|
2017-11-19 16:37:59 -06:00
|
|
|
//[mir]~^^ ERROR [E0507]
|
2013-06-20 14:11:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn let_pat() {
|
2014-05-25 05:10:11 -05:00
|
|
|
let &_x = &"hi".to_string();
|
2017-10-04 06:29:55 -05:00
|
|
|
//[ast]~^ ERROR cannot move out of borrowed content [E0507]
|
2017-11-19 16:37:59 -06:00
|
|
|
//[mir]~^^ ERROR [E0507]
|
2013-06-20 14:11:47 -05:00
|
|
|
}
|
|
|
|
|
2013-09-23 19:20:36 -05:00
|
|
|
pub fn main() {}
|