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
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/coerce-suggestions.rs:22:19
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
22 | let x: &str = String::new();
|
2017-11-25 08:00:26 -06:00
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| expected &str, found struct `std::string::String`
|
|
|
|
| help: consider borrowing here: `&String::new()`
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
|
|
|
= note: expected type `&str`
|
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-11-20 06:13:27 -06:00
|
|
|
--> $DIR/coerce-suggestions.rs:28:10
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
28 | test(&y);
|
2016-11-01 10:00:24 -05:00
|
|
|
| ^^ 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-11-20 06:13:27 -06:00
|
|
|
--> $DIR/coerce-suggestions.rs:32:11
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
32 | 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-11-20 06:13:27 -06:00
|
|
|
--> $DIR/coerce-suggestions.rs:37:9
|
2016-11-01 10:00:24 -05:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
37 | f = box f;
|
2016-11-01 10:00:24 -05:00
|
|
|
| ^^^^^ cyclic type of infinite size
|
|
|
|
|
2017-06-01 01:48:19 -05:00
|
|
|
error[E0308]: mismatched types
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/coerce-suggestions.rs:42:9
|
2017-06-01 01:48:19 -05:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
42 | s = format!("foo");
|
2017-11-25 08:00:26 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| expected mutable reference, found struct `std::string::String`
|
|
|
|
| help: consider mutably borrowing here: `&mut format!("foo")`
|
2017-06-01 01:48:19 -05:00
|
|
|
|
|
|
|
|
= note: expected type `&mut std::string::String`
|
|
|
|
found type `std::string::String`
|
2017-11-21 13:48:35 -06:00
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-06-01 01:48:19 -05:00
|
|
|
|
2017-07-02 05:49:30 -05:00
|
|
|
error: aborting due to 6 previous errors
|
2016-11-01 10:00:24 -05:00
|
|
|
|