1 error[E0308]: mismatched types
2 --> $DIR/coerce-suggestions.rs:7:20
4 LL | let x: usize = String::new();
5 | ^^^^^^^^^^^^^ expected usize, found struct `std::string::String`
7 = note: expected type `usize`
8 found struct `std::string::String`
10 error[E0308]: mismatched types
11 --> $DIR/coerce-suggestions.rs:9:19
13 LL | let x: &str = String::new();
16 | expected &str, found struct `std::string::String`
17 | help: consider borrowing here: `&String::new()`
19 = note: expected reference `&str`
20 found struct `std::string::String`
22 error[E0308]: mismatched types
23 --> $DIR/coerce-suggestions.rs:12:10
26 | ^^ types differ in mutability
28 = note: expected mutable reference `&mut std::string::String`
29 found reference `&std::string::String`
31 error[E0308]: mismatched types
32 --> $DIR/coerce-suggestions.rs:14:11
35 | ^^ types differ in mutability
37 = note: expected mutable reference `&mut i32`
38 found reference `&std::string::String`
40 error[E0308]: mismatched types
41 --> $DIR/coerce-suggestions.rs:17:9
46 | cyclic type of infinite size
47 | help: try using a conversion method: `(box f).to_string()`
49 error[E0308]: mismatched types
50 --> $DIR/coerce-suggestions.rs:21:9
52 LL | s = format!("foo");
53 | ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String`
55 = note: expected mutable reference `&mut std::string::String`
56 found struct `std::string::String`
57 = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
59 error: aborting due to 6 previous errors
61 For more information about this error, try `rustc --explain E0308`.