|
| 1 | +error[E0308]: mismatched types |
| 2 | + --> $DIR/coerce-suggestions.rs:17:20 |
| 3 | + | |
| 4 | +17 | let x: usize = String::new(); |
| 5 | + | ^^^^^^^^^^^^^ expected usize, found struct `std::string::String` |
| 6 | + | |
| 7 | + = note: expected type `usize` |
| 8 | + = note: found type `std::string::String` |
| 9 | + = help: here are some functions which might fulfill your needs: |
| 10 | + - .capacity() |
| 11 | + - .len() |
| 12 | + |
| 13 | +error[E0308]: mismatched types |
| 14 | + --> $DIR/coerce-suggestions.rs:23:19 |
| 15 | + | |
| 16 | +23 | let x: &str = String::new(); |
| 17 | + | ^^^^^^^^^^^^^ expected &str, found struct `std::string::String` |
| 18 | + | |
| 19 | + = note: expected type `&str` |
| 20 | + = note: found type `std::string::String` |
| 21 | + = help: try with `&String::new()` |
| 22 | + |
| 23 | +error[E0308]: mismatched types |
| 24 | + --> $DIR/coerce-suggestions.rs:30:10 |
| 25 | + | |
| 26 | +30 | test(&y); |
| 27 | + | ^^ types differ in mutability |
| 28 | + | |
| 29 | + = note: expected type `&mut std::string::String` |
| 30 | + = note: found type `&std::string::String` |
| 31 | + = help: try with `&mut y` |
| 32 | + |
| 33 | +error[E0308]: mismatched types |
| 34 | + --> $DIR/coerce-suggestions.rs:36:11 |
| 35 | + | |
| 36 | +36 | test2(&y); |
| 37 | + | ^^ types differ in mutability |
| 38 | + | |
| 39 | + = note: expected type `&mut i32` |
| 40 | + = note: found type `&std::string::String` |
| 41 | + |
| 42 | +error[E0308]: mismatched types |
| 43 | + --> $DIR/coerce-suggestions.rs:42:9 |
| 44 | + | |
| 45 | +42 | f = box f; |
| 46 | + | ^^^^^ cyclic type of infinite size |
| 47 | + | |
| 48 | + = note: expected type `_` |
| 49 | + = note: found type `Box<_>` |
| 50 | + |
| 51 | +error: aborting due to 5 previous errors |
| 52 | + |
0 commit comments