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

64 lines
2.0 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`
2017-01-11 15:55:41 -06:00
found type `std::string::String`
= help: here are some functions which might fulfill your needs:
- .capacity()
- .len()
error[E0308]: mismatched types
2017-11-20 06:13:27 -06:00
--> $DIR/coerce-suggestions.rs:22:19
|
2017-11-20 06:13:27 -06:00
22 | let x: &str = String::new();
| ^^^^^^^^^^^^^
| |
| expected &str, found struct `std::string::String`
| help: consider borrowing here: `&String::new()`
|
= note: expected type `&str`
2017-01-11 15:55:41 -06:00
found type `std::string::String`
error[E0308]: mismatched types
2017-11-20 06:13:27 -06:00
--> $DIR/coerce-suggestions.rs:28:10
|
2017-11-20 06:13:27 -06:00
28 | 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`
error[E0308]: mismatched types
2017-11-20 06:13:27 -06:00
--> $DIR/coerce-suggestions.rs:32:11
|
2017-11-20 06:13:27 -06:00
32 | test2(&y);
| ^^ types differ in mutability
|
= note: expected type `&mut i32`
2017-01-11 15:55:41 -06:00
found type `&std::string::String`
error[E0308]: mismatched types
2017-11-20 06:13:27 -06:00
--> $DIR/coerce-suggestions.rs:37:9
|
2017-11-20 06:13:27 -06:00
37 | f = box f;
| ^^^^^ cyclic type of infinite size
error[E0308]: mismatched types
2017-11-20 06:13:27 -06:00
--> $DIR/coerce-suggestions.rs:42:9
|
2017-11-20 06:13:27 -06:00
42 | s = format!("foo");
| ^^^^^^^^^^^^^^
| |
| expected mutable reference, found struct `std::string::String`
| help: consider mutably borrowing here: `&mut format!("foo")`
|
= note: expected type `&mut std::string::String`
found type `std::string::String`
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to 6 previous errors