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