about summary refs log tree commit diff
path: root/tests/ui/typeck/conversion-methods.stderr
blob: fa8928f1454c00e8c1736e4545912d20aa279541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
error[E0308]: mismatched types
  --> $DIR/conversion-methods.rs:5:41
   |
LL |     let _tis_an_instants_play: String = "'Tis a fond Ambush—";
   |                                ------   ^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `&str`
   |                                |
   |                                expected due to this
   |
help: try using a conversion method
   |
LL |     let _tis_an_instants_play: String = "'Tis a fond Ambush—".to_string();
   |                                                              ++++++++++++

error[E0308]: mismatched types
  --> $DIR/conversion-methods.rs:6:40
   |
LL |     let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
   |                              -------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `PathBuf`, found `&Path`
   |                              |
   |                              expected due to this
   |
help: try using a conversion method
   |
LL |     let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise").to_path_buf();
   |                                                                          ++++++++++++++

error[E0308]: mismatched types
  --> $DIR/conversion-methods.rs:9:40
   |
LL |     let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here
   |                               ------   ^ expected `String`, found integer
   |                               |
   |                               expected due to this
   |
help: try using a conversion method
   |
LL |     let _but_should_the_play: String = 2.to_string(); // Perhaps surprisingly, we suggest .to_string() here
   |                                         ++++++++++++

error[E0308]: mismatched types
  --> $DIR/conversion-methods.rs:12:47
   |
LL |     let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3];
   |                                  ----------   ^^^^^^^^^^ expected `Vec<usize>`, found `&[{integer}; 3]`
   |                                  |
   |                                  expected due to this
   |
   = note: expected struct `Vec<usize>`
           found reference `&[{integer}; 3]`
help: try using a conversion method
   |
LL |     let _prove_piercing_earnest: Vec<usize> = (&[1, 2, 3]).to_vec();
   |                                               +          ++++++++++

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.