]> git.proxmox.com Git - rustc.git/blob - src/test/ui/typeck/conversion-methods.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / typeck / 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 | ------ ^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
6 | | |
7 | | expected struct `String`, found `&str`
8 | expected due to this
9
10 error[E0308]: mismatched types
11 --> $DIR/conversion-methods.rs:6:40
12 |
13 LL | let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
14 | ------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_path_buf()`
15 | | |
16 | | expected struct `PathBuf`, found `&Path`
17 | expected due to this
18
19 error[E0308]: mismatched types
20 --> $DIR/conversion-methods.rs:9:40
21 |
22 LL | let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here
23 | ------ ^- help: try using a conversion method: `.to_string()`
24 | | |
25 | | expected struct `String`, found integer
26 | expected due to this
27
28 error[E0308]: mismatched types
29 --> $DIR/conversion-methods.rs:12:47
30 |
31 LL | let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3];
32 | ---------- ^^^^^^^^^^ expected struct `Vec`, found `&[{integer}; 3]`
33 | |
34 | expected due to this
35 |
36 = note: expected struct `Vec<usize>`
37 found reference `&[{integer}; 3]`
38 help: try using a conversion method
39 |
40 LL | let _prove_piercing_earnest: Vec<usize> = (&[1, 2, 3]).to_vec();
41 | + ++++++++++
42
43 error: aborting due to 4 previous errors
44
45 For more information about this error, try `rustc --explain E0308`.