]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-105494.stderr
Make const/fn return params more suggestable
[rust.git] / tests / ui / suggestions / issue-105494.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-105494.rs:2:19
3    |
4 LL |     let _v: i32 = (1 as i32).to_string();
5    |             ---   ^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
6    |             |
7    |             expected due to this
8    |
9 help: try removing the method call
10    |
11 LL -     let _v: i32 = (1 as i32).to_string();
12 LL +     let _v: i32 = (1 as i32);
13    |
14
15 error[E0308]: mismatched types
16   --> $DIR/issue-105494.rs:5:19
17    |
18 LL |     let _v: i32 = (1 as i128).to_string();
19    |             ---   ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
20    |             |
21    |             expected due to this
22
23 error[E0308]: mismatched types
24   --> $DIR/issue-105494.rs:7:20
25    |
26 LL |     let _v: &str = "foo".to_string();
27    |             ----   ^^^^^^^^^^^^^^^^^ expected `&str`, found `String`
28    |             |
29    |             expected due to this
30    |
31 help: try removing the method call
32    |
33 LL -     let _v: &str = "foo".to_string();
34 LL +     let _v: &str = "foo";
35    |
36
37 error[E0308]: mismatched types
38   --> $DIR/issue-105494.rs:14:12
39    |
40 LL |     let mut path: String = "/usr".to_string();
41    |                   ------ expected due to this type
42 ...
43 LL |     path = format!("{}/{}", path, folder).as_str();
44    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `&str`
45    |
46 help: try removing the method call
47    |
48 LL -     path = format!("{}/{}", path, folder).as_str();
49 LL +     path = format!("{}/{}", path, folder);
50    |
51
52 error: aborting due to 4 previous errors
53
54 For more information about this error, try `rustc --explain E0308`.