1 error[E0308]: mismatched types
2 --> $DIR/issue-105494.rs:2:19
4 LL | let _v: i32 = (1 as i32).to_string();
5 | --- ^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
9 help: try removing the method call
11 LL - let _v: i32 = (1 as i32).to_string();
12 LL + let _v: i32 = (1 as i32);
15 error[E0308]: mismatched types
16 --> $DIR/issue-105494.rs:5:19
18 LL | let _v: i32 = (1 as i128).to_string();
19 | --- ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
21 | expected due to this
23 error[E0308]: mismatched types
24 --> $DIR/issue-105494.rs:7:20
26 LL | let _v: &str = "foo".to_string();
27 | ---- ^^^^^^^^^^^^^^^^^ expected `&str`, found `String`
29 | expected due to this
31 help: try removing the method call
33 LL - let _v: &str = "foo".to_string();
34 LL + let _v: &str = "foo";
37 error[E0308]: mismatched types
38 --> $DIR/issue-105494.rs:14:12
40 LL | let mut path: String = "/usr".to_string();
41 | ------ expected due to this type
43 LL | path = format!("{}/{}", path, folder).as_str();
44 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `&str`
46 help: try removing the method call
48 LL - path = format!("{}/{}", path, folder).as_str();
49 LL + path = format!("{}/{}", path, folder);
52 error: aborting due to 4 previous errors
54 For more information about this error, try `rustc --explain E0308`.