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