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

60 lines
1.8 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`
|
= 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()`
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`
|
= note: expected type `&mut std::string::String`
found type `std::string::String`
= help: try with `&mut format!("foo")`
2017-11-20 12:03:20 -06:00
= note: this error originates in a macro outside of the current crate (run with -Z external-macro-backtrace for more info)
error: aborting due to 6 previous errors