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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.7 KiB
Plaintext
Raw Normal View History

error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/coerce-suggestions.rs:7:20
|
2018-02-23 00:42:32 +00:00
LL | let x: usize = String::new();
| ----- ^^^^^^^^^^^^^ expected `usize`, found struct `String`
| |
| expected due to this
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/coerce-suggestions.rs:9:19
|
2018-02-23 00:42:32 +00:00
LL | let x: &str = String::new();
| ---- ^^^^^^^^^^^^^
| | |
| | expected `&str`, found struct `String`
| | help: consider borrowing here: `&String::new()`
| expected due to this
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/coerce-suggestions.rs:12:10
|
2018-02-23 00:42:32 +00:00
LL | test(&y);
| ^^ types differ in mutability
|
= note: expected mutable reference `&mut String`
found reference `&String`
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/coerce-suggestions.rs:14:11
|
2018-02-23 00:42:32 +00:00
LL | test2(&y);
| ^^ types differ in mutability
|
= note: expected mutable reference `&mut i32`
found reference `&String`
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/coerce-suggestions.rs:17:9
|
LL | f = Box::new(f);
| ^^^^^^^^^^^ cyclic type of infinite size
|
help: consider unboxing the value
|
LL | f = *Box::new(f);
| +
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/coerce-suggestions.rs:21:9
|
2018-02-23 00:42:32 +00:00
LL | s = format!("foo");
| ^^^^^^^^^^^^^^ expected `&mut String`, found struct `String`
|
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 6 previous errors
2018-03-03 14:59:40 +00:00
For more information about this error, try `rustc --explain E0308`.