From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../coercion/coerce-expect-unsized-ascribed.stderr | 129 +++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr (limited to 'src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr') diff --git a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr new file mode 100644 index 000000000..9d614e610 --- /dev/null +++ b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr @@ -0,0 +1,129 @@ +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:9:13 + | +LL | let _ = box { [1, 2, 3] }: Box<[i32]>; + | ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | + = note: expected struct `Box<[i32]>` + found struct `Box<[i32; 3]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:10:13 + | +LL | let _ = box if true { [1, 2, 3] } else { [1, 3, 4] }: Box<[i32]>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | + = note: expected struct `Box<[i32]>` + found struct `Box<[i32; 3]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:11:13 + | +LL | let _ = box match true { true => [1, 2, 3], false => [1, 3, 4] }: Box<[i32]>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | + = note: expected struct `Box<[i32]>` + found struct `Box<[i32; 3]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:13:13 + | +LL | let _ = box { |x| (x as u8) }: Box _>; + | ^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure + | + = note: expected struct `Box u8>` + found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:19: 13:22]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:14:13 + | +LL | let _ = box if true { false } else { true }: Box; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool` + | + = note: expected struct `Box` + found struct `Box` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:15:13 + | +LL | let _ = box match true { true => 'a', false => 'b' }: Box; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char` + | + = note: expected struct `Box` + found struct `Box` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:17:13 + | +LL | let _ = &{ [1, 2, 3] }: &[i32]; + | ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | + = note: expected reference `&[i32]` + found reference `&[i32; 3]` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:18:13 + | +LL | let _ = &if true { [1, 2, 3] } else { [1, 3, 4] }: &[i32]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | + = note: expected reference `&[i32]` + found reference `&[i32; 3]` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:19:13 + | +LL | let _ = &match true { true => [1, 2, 3], false => [1, 3, 4] }: &[i32]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | + = note: expected reference `&[i32]` + found reference `&[i32; 3]` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:21:13 + | +LL | let _ = &{ |x| (x as u8) }: &dyn Fn(i32) -> _; + | ^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure + | + = note: expected reference `&dyn Fn(i32) -> u8` + found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:16: 21:19]` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:22:13 + | +LL | let _ = &if true { false } else { true }: &dyn Debug; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool` + | + = note: expected reference `&dyn Debug` + found reference `&bool` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:23:13 + | +LL | let _ = &match true { true => 'a', false => 'b' }: &dyn Debug; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char` + | + = note: expected reference `&dyn Debug` + found reference `&char` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:25:13 + | +LL | let _ = Box::new([1, 2, 3]): Box<[i32]>; + | ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` + | + = note: expected struct `Box<[i32]>` + found struct `Box<[i32; 3]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:26:13 + | +LL | let _ = Box::new(|x| (x as u8)): Box _>; + | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure + | + = note: expected struct `Box u8>` + found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:25]>` + +error: aborting due to 14 previous errors + +For more information about this error, try `rustc --explain E0308`. -- cgit v1.2.3