]>
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(); |
1b1a35ee | 5 | | ----- ^^^^^^^^^^^^^ expected `usize`, found struct `String` |
60c5eb7d XL |
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 | | | | | |
1b1a35ee | 15 | | | expected `&str`, found struct `String` |
60c5eb7d XL |
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 | | | |
1b1a35ee XL |
25 | = note: expected mutable reference `&mut String` |
26 | found reference `&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 | 34 | = note: expected mutable reference `&mut i32` |
1b1a35ee | 35 | found reference `&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; |
94222f64 XL |
41 | | ^^^^^ cyclic type of infinite size |
42 | | | |
43 | help: try using a conversion method | |
44 | | | |
45 | LL | f = (box f).to_string(); | |
46 | | + +++++++++++++ | |
32a655c1 | 47 | |
7cac9316 | 48 | error[E0308]: mismatched types |
0731742a | 49 | --> $DIR/coerce-suggestions.rs:21:9 |
7cac9316 | 50 | | |
0531ce1d | 51 | LL | s = format!("foo"); |
1b1a35ee | 52 | | ^^^^^^^^^^^^^^ expected `&mut String`, found struct `String` |
7cac9316 | 53 | | |
17df50a5 | 54 | = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info) |
7cac9316 | 55 | |
041b39d2 | 56 | error: aborting due to 6 previous errors |
32a655c1 | 57 | |
0531ce1d | 58 | For more information about this error, try `rustc --explain E0308`. |