]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/coerce-suggestions.rs
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
[rust.git] / src / test / ui / span / coerce-suggestions.rs
1 #![feature(box_syntax)]
2
3 fn test(_x: &mut String) {}
4 fn test2(_x: &mut i32) {}
5
6 fn main() {
7     let x: usize = String::new();
8     //~^ ERROR E0308
9     let x: &str = String::new();
10     //~^ ERROR E0308
11     let y = String::new();
12     test(&y);
13     //~^ ERROR E0308
14     test2(&y);
15     //~^ ERROR E0308
16     let f;
17     f = box f;
18     //~^ ERROR E0308
19
20     let s = &mut String::new();
21     s = format!("foo");
22     //~^ ERROR E0308
23 }