1 error[E0308]: mismatched types
2 --> $DIR/coerce-suggestions.rs:7:20
4 LL | let x: usize = String::new();
5 | ----- ^^^^^^^^^^^^^ expected `usize`, found struct `String`
9 error[E0308]: mismatched types
10 --> $DIR/coerce-suggestions.rs:9:19
12 LL | let x: &str = String::new();
15 | | expected `&str`, found struct `String`
16 | | help: consider borrowing here: `&String::new()`
17 | expected due to this
19 error[E0308]: mismatched types
20 --> $DIR/coerce-suggestions.rs:12:10
23 | ---- ^^ types differ in mutability
25 | arguments to this function are incorrect
27 = note: expected mutable reference `&mut String`
28 found reference `&String`
29 note: function defined here
30 --> $DIR/coerce-suggestions.rs:1:4
32 LL | fn test(_x: &mut String) {}
33 | ^^^^ ---------------
35 error[E0308]: mismatched types
36 --> $DIR/coerce-suggestions.rs:14:11
39 | ----- ^^ types differ in mutability
41 | arguments to this function are incorrect
43 = note: expected mutable reference `&mut i32`
44 found reference `&String`
45 note: function defined here
46 --> $DIR/coerce-suggestions.rs:3:4
48 LL | fn test2(_x: &mut i32) {}
51 error[E0308]: mismatched types
52 --> $DIR/coerce-suggestions.rs:17:9
55 | ^^^^^^^^^^^ cyclic type of infinite size
57 help: consider unboxing the value
59 LL | f = *Box::new(f);
62 error[E0308]: mismatched types
63 --> $DIR/coerce-suggestions.rs:21:9
65 LL | s = format!("foo");
66 | ^^^^^^^^^^^^^^ expected `&mut String`, found struct `String`
68 = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
70 error: aborting due to 6 previous errors
72 For more information about this error, try `rustc --explain E0308`.