]>
Commit | Line | Data |
---|---|---|
32a655c1 | 1 | error[E0308]: mismatched types |
0731742a | 2 | --> $DIR/coerce-suggestions.rs:7:20 |
32a655c1 | 3 | | |
0531ce1d | 4 | LL | let x: usize = String::new(); |
60c5eb7d XL |
5 | | ----- ^^^^^^^^^^^^^ expected `usize`, found struct `std::string::String` |
6 | | | | |
7 | | expected due to this | |
32a655c1 SL |
8 | |
9 | error[E0308]: mismatched types | |
0731742a | 10 | --> $DIR/coerce-suggestions.rs:9:19 |
32a655c1 | 11 | | |
0531ce1d | 12 | LL | let x: &str = String::new(); |
60c5eb7d XL |
13 | | ---- ^^^^^^^^^^^^^ |
14 | | | | | |
15 | | | expected `&str`, found struct `std::string::String` | |
16 | | | help: consider borrowing here: `&String::new()` | |
17 | | expected due to this | |
32a655c1 SL |
18 | |
19 | error[E0308]: mismatched types | |
0731742a | 20 | --> $DIR/coerce-suggestions.rs:12:10 |
32a655c1 | 21 | | |
0531ce1d | 22 | LL | test(&y); |
32a655c1 SL |
23 | | ^^ types differ in mutability |
24 | | | |
60c5eb7d XL |
25 | = note: expected mutable reference `&mut std::string::String` |
26 | found reference `&std::string::String` | |
32a655c1 SL |
27 | |
28 | error[E0308]: mismatched types | |
0731742a | 29 | --> $DIR/coerce-suggestions.rs:14:11 |
32a655c1 | 30 | | |
0531ce1d | 31 | LL | test2(&y); |
32a655c1 SL |
32 | | ^^ types differ in mutability |
33 | | | |
60c5eb7d XL |
34 | = note: expected mutable reference `&mut i32` |
35 | found reference `&std::string::String` | |
32a655c1 SL |
36 | |
37 | error[E0308]: mismatched types | |
0731742a | 38 | --> $DIR/coerce-suggestions.rs:17:9 |
32a655c1 | 39 | | |
0531ce1d | 40 | LL | f = box f; |
2c00a5a8 XL |
41 | | ^^^^^ |
42 | | | | |
43 | | cyclic type of infinite size | |
e74abb32 | 44 | | help: try using a conversion method: `(box f).to_string()` |
32a655c1 | 45 | |
7cac9316 | 46 | error[E0308]: mismatched types |
0731742a | 47 | --> $DIR/coerce-suggestions.rs:21:9 |
7cac9316 | 48 | | |
0531ce1d | 49 | LL | s = format!("foo"); |
60c5eb7d | 50 | | ^^^^^^^^^^^^^^ expected `&mut std::string::String`, found struct `std::string::String` |
7cac9316 | 51 | | |
ff7c6d11 | 52 | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) |
7cac9316 | 53 | |
041b39d2 | 54 | error: aborting due to 6 previous errors |
32a655c1 | 55 | |
0531ce1d | 56 | For more information about this error, try `rustc --explain E0308`. |