2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2022-11-19 21:11:00 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:9:27
2018-08-08 12:28:26 +00:00
|
2023-02-27 13:07:44 +00:00
LL | let _ = type_ascribe!(Box::new({ [1, 2, 3] }), Box<[i32]>);
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2022-11-19 21:11:00 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:10:27
2018-08-08 12:28:26 +00:00
|
2023-02-27 13:07:44 +00:00
LL | let _ = type_ascribe!(Box::new( if true { [1, 2, 3] } else { [1, 3, 4] }), Box<[i32]>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:12:9
2018-08-08 12:28:26 +00:00
|
2023-02-27 13:07:44 +00:00
LL | Box::new( match true { true => [1, 2, 3], false => [1, 3, 4] }), Box<[i32]>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:14:27
2018-08-08 12:28:26 +00:00
|
2023-02-27 13:07:44 +00:00
LL | let _ = type_ascribe!(Box::new( { |x| (x as u8) }), Box<dyn Fn(i32) -> _>);
2023-09-09 06:36:50 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<{closure@coerce-expect-unsized-ascribed.rs:14:39}>`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected struct `Box<dyn Fn(i32) -> u8>`
2023-09-09 06:36:50 +00:00
found struct `Box<{closure@$DIR/coerce-expect-unsized-ascribed.rs:14:39: 14:42}>`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:15:27
2018-08-08 12:28:26 +00:00
|
2023-02-27 13:07:44 +00:00
LL | let _ = type_ascribe!(Box::new( if true { false } else { true }), Box<dyn Debug>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<bool>`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected struct `Box<dyn Debug>`
found struct `Box<bool>`
2024-08-07 01:18:15 +00:00
= help: `bool` implements `Debug` so you could box the found value and coerce it to the trait object `Box<dyn Debug>`, you will have to change the expected type as well
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:16:27
2018-08-08 12:28:26 +00:00
|
2023-02-27 13:07:44 +00:00
LL | let _ = type_ascribe!(Box::new( match true { true => 'a', false => 'b' }), Box<dyn Debug>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<char>`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected struct `Box<dyn Debug>`
found struct `Box<char>`
2024-08-07 01:18:15 +00:00
= help: `char` implements `Debug` so you could box the found value and coerce it to the trait object `Box<dyn Debug>`, you will have to change the expected type as well
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:18:27
2018-08-08 12:28:26 +00:00
|
2022-11-19 21:11:00 +00:00
LL | let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]);
2023-01-03 02:00:33 +00:00
| ^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
2018-08-08 12:28:26 +00:00
|
2019-11-13 22:16:56 +00:00
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:19:27
2018-08-08 12:28:26 +00:00
|
2022-11-19 21:11:00 +00:00
LL | let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]);
2023-01-03 02:00:33 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
2018-08-08 12:28:26 +00:00
|
2019-11-13 22:16:56 +00:00
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:20:27
2018-08-08 12:28:26 +00:00
|
2022-11-19 21:11:00 +00:00
LL | let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3, 4] }, &[i32]);
2023-01-03 02:00:33 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
2018-08-08 12:28:26 +00:00
|
2019-11-13 22:16:56 +00:00
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:22:27
2018-08-08 12:28:26 +00:00
|
2022-11-19 21:11:00 +00:00
LL | let _ = type_ascribe!(&{ |x| (x as u8) }, &dyn Fn(i32) -> _);
2023-09-09 06:36:50 +00:00
| ^^^^^^^^^^^^^^^^^^ expected `&dyn Fn(i32) -> u8`, found `&{closure@coerce-expect-unsized-ascribed.rs:22:30}`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected reference `&dyn Fn(i32) -> u8`
2023-09-09 06:36:50 +00:00
found reference `&{closure@$DIR/coerce-expect-unsized-ascribed.rs:22:30: 22:33}`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:23:27
2018-08-08 12:28:26 +00:00
|
2022-11-19 21:11:00 +00:00
LL | let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug);
2023-01-03 02:00:33 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&bool`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected reference `&dyn Debug`
2019-11-13 22:16:56 +00:00
found reference `&bool`
2024-08-07 01:18:15 +00:00
= help: `bool` implements `Debug` so you could box the found value and coerce it to the trait object `Box<dyn Debug>`, you will have to change the expected type as well
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:24:27
2018-08-08 12:28:26 +00:00
|
2022-11-19 21:11:00 +00:00
LL | let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn Debug);
2023-01-03 02:00:33 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&char`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected reference `&dyn Debug`
2019-11-13 22:16:56 +00:00
found reference `&char`
2024-08-07 01:18:15 +00:00
= help: `char` implements `Debug` so you could box the found value and coerce it to the trait object `Box<dyn Debug>`, you will have to change the expected type as well
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:26:27
2018-08-08 12:28:26 +00:00
|
2022-11-19 21:11:00 +00:00
LL | let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>);
2023-01-03 02:00:33 +00:00
| ^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2023-02-27 13:07:44 +00:00
--> $DIR/coerce-expect-unsized-ascribed.rs:27:27
2018-08-08 12:28:26 +00:00
|
2022-11-19 21:11:00 +00:00
LL | let _ = type_ascribe!(Box::new(|x| (x as u8)), Box<dyn Fn(i32) -> _>);
2023-09-09 06:36:50 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<{closure@coerce-expect-unsized-ascribed.rs:27:36}>`
2018-08-08 12:28:26 +00:00
|
2020-09-02 07:40:56 +00:00
= note: expected struct `Box<dyn Fn(i32) -> u8>`
2023-09-09 06:36:50 +00:00
found struct `Box<{closure@$DIR/coerce-expect-unsized-ascribed.rs:27:36: 27:39}>`
2018-08-08 12:28:26 +00:00
error: aborting due to 14 previous errors
For more information about this error, try `rustc --explain E0308`.