rust/src/test/ui/span/coerce-suggestions.stderr

56 lines
1.5 KiB
Plaintext
Raw Normal View History

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`
= note: 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`
= note: found type `std::string::String`
2016-12-20 04:43:19 -06:00
= help: here are some functions which might fulfill your needs:
- .as_str()
- .trim()
- .trim_left()
- .trim_right()
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:30:10
|
30 | test(&y);
| ^^ types differ in mutability
|
= note: expected type `&mut std::string::String`
= note: found type `&std::string::String`
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:36:11
|
36 | test2(&y);
| ^^ types differ in mutability
|
= note: expected type `&mut i32`
= note: found type `&std::string::String`
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:42:9
|
42 | f = box f;
| ^^^^^ cyclic type of infinite size
|
= note: expected type `_`
= note: found type `Box<_>`
error: aborting due to 5 previous errors