77f4022303
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
63 lines
1.8 KiB
Plaintext
63 lines
1.8 KiB
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/coerce-suggestions.rs:17:20
|
|
|
|
|
17 | let x: usize = String::new();
|
|
| ^^^^^^^^^^^^^ expected usize, found struct `std::string::String`
|
|
|
|
|
= note: expected type `usize`
|
|
found type `std::string::String`
|
|
= help: here are some functions which might fulfill your needs:
|
|
- .capacity()
|
|
- .len()
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/coerce-suggestions.rs:23:19
|
|
|
|
|
23 | let x: &str = String::new();
|
|
| ^^^^^^^^^^^^^ expected &str, found struct `std::string::String`
|
|
|
|
|
= note: expected type `&str`
|
|
found type `std::string::String`
|
|
= help: try with `&String::new()`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/coerce-suggestions.rs:30:10
|
|
|
|
|
30 | test(&y);
|
|
| ^^ types differ in mutability
|
|
|
|
|
= note: expected type `&mut std::string::String`
|
|
found type `&std::string::String`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/coerce-suggestions.rs:35:11
|
|
|
|
|
35 | test2(&y);
|
|
| ^^ types differ in mutability
|
|
|
|
|
= note: expected type `&mut i32`
|
|
found type `&std::string::String`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/coerce-suggestions.rs:41:9
|
|
|
|
|
41 | f = box f;
|
|
| ^^^^^ cyclic type of infinite size
|
|
|
|
|
= note: expected type `_`
|
|
found type `std::boxed::Box<_>`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/coerce-suggestions.rs:48:9
|
|
|
|
|
48 | s = format!("foo");
|
|
| ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String`
|
|
|
|
|
= note: expected type `&mut std::string::String`
|
|
found type `std::string::String`
|
|
= help: try with `&mut format!("foo")`
|
|
= note: this error originates in a macro outside of the current crate
|
|
|
|
error: aborting due to 6 previous errors
|
|
|