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