1 error[E0308]: mismatched types
2 --> $DIR/conversion-methods.rs:15:41
4 LL | let _tis_an_instants_play: String = "'Tis a fond Ambush—"; //~ ERROR mismatched types
5 | ^^^^^^^^^^^^^^^^^^^^^
7 | expected struct `std::string::String`, found reference
8 | help: try using a conversion method: `"'Tis a fond Ambush—".to_string()`
10 = note: expected type `std::string::String`
11 found type `&'static str`
13 error[E0308]: mismatched types
14 --> $DIR/conversion-methods.rs:16:40
16 LL | let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 | expected struct `std::path::PathBuf`, found reference
20 | help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()`
22 = note: expected type `std::path::PathBuf`
23 found type `&std::path::Path`
25 error[E0308]: mismatched types
26 --> $DIR/conversion-methods.rs:19:40
28 LL | let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here
31 | expected struct `std::string::String`, found integral variable
32 | help: try using a conversion method: `2.to_string()`
34 = note: expected type `std::string::String`
35 found type `{integer}`
37 error[E0308]: mismatched types
38 --> $DIR/conversion-methods.rs:22:47
40 LL | let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3]; //~ ERROR mismatched types
43 | expected struct `std::vec::Vec`, found reference
44 | help: try using a conversion method: `&[1, 2, 3].to_vec()`
46 = note: expected type `std::vec::Vec<usize>`
47 found type `&[{integer}; 3]`
49 error: aborting due to 4 previous errors
51 For more information about this error, try `rustc --explain E0308`.