rust/tests/ui/span/coerce-suggestions.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
409 B
Rust
Raw Normal View History

fn test(_x: &mut String) {}
fn test2(_x: &mut i32) {}
fn main() {
let x: usize = String::new();
2016-10-30 22:06:30 +00:00
//~^ ERROR E0308
let x: &str = String::new();
2016-10-30 22:06:30 +00:00
//~^ ERROR E0308
let y = String::new();
test(&y);
2016-10-30 22:06:30 +00:00
//~^ ERROR E0308
test2(&y);
2016-10-30 22:06:30 +00:00
//~^ ERROR E0308
let f;
f = Box::new(f);
2016-10-30 22:06:30 +00:00
//~^ ERROR E0308
let s = &mut String::new();
s = format!("foo");
//~^ ERROR E0308
}