2016-11-01 10:00:24 -05:00
|
|
|
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`
|
2017-01-11 15:55:41 -06:00
|
|
|
found type `std::string::String`
|
2016-11-01 10:00:24 -05:00
|
|
|
= help: here are some functions which might fulfill your needs:
|
2017-01-07 23:12:33 -06:00
|
|
|
- .capacity()
|
|
|
|
- .len()
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
|
|
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`
|
2017-01-11 15:55:41 -06:00
|
|
|
found type `std::string::String`
|
2017-04-21 06:28:31 -05:00
|
|
|
= help: try with `&String::new()`
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/coerce-suggestions.rs:30:10
|
|
|
|
|
|
|
|
|
30 | test(&y);
|
|
|
|
| ^^ types differ in mutability
|
|
|
|
|
|
|
|
|
= note: expected type `&mut std::string::String`
|
2017-01-11 15:55:41 -06:00
|
|
|
found type `&std::string::String`
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2017-04-21 06:28:31 -05:00
|
|
|
--> $DIR/coerce-suggestions.rs:35:11
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
2017-04-21 06:28:31 -05:00
|
|
|
35 | test2(&y);
|
2016-11-01 10:00:24 -05:00
|
|
|
| ^^ types differ in mutability
|
|
|
|
|
|
|
|
|
= note: expected type `&mut i32`
|
2017-01-11 15:55:41 -06:00
|
|
|
found type `&std::string::String`
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2017-04-21 06:28:31 -05:00
|
|
|
--> $DIR/coerce-suggestions.rs:41:9
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
2017-04-21 06:28:31 -05:00
|
|
|
41 | f = box f;
|
2016-11-01 10:00:24 -05:00
|
|
|
| ^^^^^ cyclic type of infinite size
|
|
|
|
|
|
|
|
|
= note: expected type `_`
|
2017-01-21 08:40:31 -06:00
|
|
|
found type `std::boxed::Box<_>`
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
|