rust/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr

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

130 lines
4.9 KiB
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:9:13
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _ = box { [1, 2, 3] }: Box<[i32]>;
| ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
2018-08-08 07:28:26 -05:00
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:10:13
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _ = box if true { [1, 2, 3] } else { [1, 3, 4] }: Box<[i32]>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
2018-08-08 07:28:26 -05:00
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:11:13
2018-08-08 07:28:26 -05:00
|
LL | let _ = box match true { true => [1, 2, 3], false => [1, 3, 4] }: Box<[i32]>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
2018-08-08 07:28:26 -05:00
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:13:13
2018-08-08 07:28:26 -05:00
|
2019-05-28 13:46:13 -05:00
LL | let _ = box { |x| (x as u8) }: Box<dyn Fn(i32) -> _>;
| ^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
2018-08-08 07:28:26 -05:00
|
= note: expected struct `Box<dyn Fn(i32) -> u8>`
2022-06-27 00:45:35 -05:00
found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:19: 13:22]>`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:14:13
2018-08-08 07:28:26 -05:00
|
2019-05-28 13:46:13 -05:00
LL | let _ = box if true { false } else { true }: Box<dyn Debug>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool`
2018-08-08 07:28:26 -05:00
|
= note: expected struct `Box<dyn Debug>`
found struct `Box<bool>`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:15:13
2018-08-08 07:28:26 -05:00
|
2019-05-28 13:46:13 -05:00
LL | let _ = box match true { true => 'a', false => 'b' }: Box<dyn Debug>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char`
2018-08-08 07:28:26 -05:00
|
= note: expected struct `Box<dyn Debug>`
found struct `Box<char>`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:17:13
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _ = &{ [1, 2, 3] }: &[i32];
| ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
2018-08-08 07:28:26 -05:00
|
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:18:13
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _ = &if true { [1, 2, 3] } else { [1, 3, 4] }: &[i32];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
2018-08-08 07:28:26 -05:00
|
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:19:13
2018-08-08 07:28:26 -05:00
|
LL | let _ = &match true { true => [1, 2, 3], false => [1, 3, 4] }: &[i32];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
2018-08-08 07:28:26 -05:00
|
= note: expected reference `&[i32]`
found reference `&[i32; 3]`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:21:13
2018-08-08 07:28:26 -05:00
|
2019-05-28 13:46:13 -05:00
LL | let _ = &{ |x| (x as u8) }: &dyn Fn(i32) -> _;
| ^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
2018-08-08 07:28:26 -05:00
|
= note: expected reference `&dyn Fn(i32) -> u8`
2022-06-27 00:45:35 -05:00
found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:16: 21:19]`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:22:13
2018-08-08 07:28:26 -05:00
|
2019-05-28 13:46:13 -05:00
LL | let _ = &if true { false } else { true }: &dyn Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool`
2018-08-08 07:28:26 -05:00
|
= note: expected reference `&dyn Debug`
found reference `&bool`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:23:13
2018-08-08 07:28:26 -05:00
|
2019-05-28 13:46:13 -05:00
LL | let _ = &match true { true => 'a', false => 'b' }: &dyn Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char`
2018-08-08 07:28:26 -05:00
|
= note: expected reference `&dyn Debug`
found reference `&char`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:25:13
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | let _ = Box::new([1, 2, 3]): Box<[i32]>;
| ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
2018-08-08 07:28:26 -05:00
|
= note: expected struct `Box<[i32]>`
found struct `Box<[i32; 3]>`
2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/coerce-expect-unsized-ascribed.rs:26:13
2018-08-08 07:28:26 -05:00
|
2019-05-28 13:46:13 -05:00
LL | let _ = Box::new(|x| (x as u8)): Box<dyn Fn(i32) -> _>;
| ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
2018-08-08 07:28:26 -05:00
|
= note: expected struct `Box<dyn Fn(i32) -> u8>`
2022-06-27 00:45:35 -05:00
found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:25]>`
2018-08-08 07:28:26 -05:00
error: aborting due to 14 previous errors
For more information about this error, try `rustc --explain E0308`.