2016-10-28 07:27:42 -05:00
|
|
|
fn test(_x: &mut String) {}
|
2021-08-24 19:39:40 -05:00
|
|
|
|
2016-10-28 07:27:42 -05:00
|
|
|
fn test2(_x: &mut i32) {}
|
|
|
|
|
2021-08-24 19:39:40 -05:00
|
|
|
|
2016-10-28 07:27:42 -05:00
|
|
|
fn main() {
|
|
|
|
let x: usize = String::new();
|
2016-10-30 17:06:30 -05:00
|
|
|
//~^ ERROR E0308
|
2016-10-28 07:27:42 -05:00
|
|
|
let x: &str = String::new();
|
2016-10-30 17:06:30 -05:00
|
|
|
//~^ ERROR E0308
|
2016-10-28 07:27:42 -05:00
|
|
|
let y = String::new();
|
|
|
|
test(&y);
|
2016-10-30 17:06:30 -05:00
|
|
|
//~^ ERROR E0308
|
2016-10-28 07:27:42 -05:00
|
|
|
test2(&y);
|
2016-10-30 17:06:30 -05:00
|
|
|
//~^ ERROR E0308
|
2016-10-28 07:27:42 -05:00
|
|
|
let f;
|
2021-08-24 19:39:40 -05:00
|
|
|
f = Box::new(f);
|
2016-10-30 17:06:30 -05:00
|
|
|
//~^ ERROR E0308
|
2017-06-01 01:48:19 -05:00
|
|
|
|
|
|
|
let s = &mut String::new();
|
|
|
|
s = format!("foo");
|
2018-07-19 07:15:43 -05:00
|
|
|
//~^ ERROR E0308
|
2016-10-28 07:27:42 -05:00
|
|
|
}
|