]> git.lizzy.rs Git - rust.git/blob - src/test/ui/conversion-methods.stderr
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / conversion-methods.stderr
1 error[E0308]: mismatched types
2   --> $DIR/conversion-methods.rs:5:41
3    |
4 LL |     let _tis_an_instants_play: String = "'Tis a fond Ambush—";
5    |                                ------   ^^^^^^^^^^^^^^^^^^^^^
6    |                                |        |
7    |                                |        expected struct `String`, found `&str`
8    |                                |        help: try using a conversion method: `"'Tis a fond Ambush—".to_string()`
9    |                                expected due to this
10
11 error[E0308]: mismatched types
12   --> $DIR/conversion-methods.rs:6:40
13    |
14 LL |     let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
15    |                              -------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16    |                              |         |
17    |                              |         expected struct `PathBuf`, found `&Path`
18    |                              |         help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()`
19    |                              expected due to this
20
21 error[E0308]: mismatched types
22   --> $DIR/conversion-methods.rs:9:40
23    |
24 LL |     let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here
25    |                               ------   ^
26    |                               |        |
27    |                               |        expected struct `String`, found integer
28    |                               |        help: try using a conversion method: `2.to_string()`
29    |                               expected due to this
30
31 error[E0308]: mismatched types
32   --> $DIR/conversion-methods.rs:12:47
33    |
34 LL |     let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3];
35    |                                  ----------   ^^^^^^^^^^
36    |                                  |            |
37    |                                  |            expected struct `Vec`, found `&[{integer}; 3]`
38    |                                  |            help: try using a conversion method: `(&[1, 2, 3]).to_vec()`
39    |                                  expected due to this
40    |
41    = note: expected struct `Vec<usize>`
42            found reference `&[{integer}; 3]`
43
44 error: aborting due to 4 previous errors
45
46 For more information about this error, try `rustc --explain E0308`.