]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / coercion / coerce-expect-unsized-ascribed.stderr
1 error[E0308]: mismatched types
2   --> $DIR/coerce-expect-unsized-ascribed.rs:9:27
3    |
4 LL |     let _ = type_ascribe!(box { [1, 2, 3] }, Box<[i32]>);
5    |                           ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
6    |
7    = note: expected struct `Box<[i32]>`
8               found struct `Box<[i32; 3]>`
9
10 error[E0308]: mismatched types
11   --> $DIR/coerce-expect-unsized-ascribed.rs:10:27
12    |
13 LL |     let _ = type_ascribe!(box if true { [1, 2, 3] } else { [1, 3, 4] }, Box<[i32]>);
14    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
15    |
16    = note: expected struct `Box<[i32]>`
17               found struct `Box<[i32; 3]>`
18
19 error[E0308]: mismatched types
20   --> $DIR/coerce-expect-unsized-ascribed.rs:11:27
21    |
22 LL |     let _ = type_ascribe!(box match true { true => [1, 2, 3], false => [1, 3, 4] }, Box<[i32]>);
23    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
24    |
25    = note: expected struct `Box<[i32]>`
26               found struct `Box<[i32; 3]>`
27
28 error[E0308]: mismatched types
29   --> $DIR/coerce-expect-unsized-ascribed.rs:13:27
30    |
31 LL |     let _ = type_ascribe!(box { |x| (x as u8) }, Box<dyn Fn(i32) -> _>);
32    |                           ^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
33    |
34    = note: expected struct `Box<dyn Fn(i32) -> u8>`
35               found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:33: 13:36]>`
36
37 error[E0308]: mismatched types
38   --> $DIR/coerce-expect-unsized-ascribed.rs:14:27
39    |
40 LL |     let _ = type_ascribe!(box if true { false } else { true }, Box<dyn Debug>);
41    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool`
42    |
43    = note: expected struct `Box<dyn Debug>`
44               found struct `Box<bool>`
45
46 error[E0308]: mismatched types
47   --> $DIR/coerce-expect-unsized-ascribed.rs:15:27
48    |
49 LL |     let _ = type_ascribe!(box match true { true => 'a', false => 'b' }, Box<dyn Debug>);
50    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char`
51    |
52    = note: expected struct `Box<dyn Debug>`
53               found struct `Box<char>`
54
55 error[E0308]: mismatched types
56   --> $DIR/coerce-expect-unsized-ascribed.rs:17:27
57    |
58 LL |     let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]);
59    |                           ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
60    |
61    = note: expected reference `&[i32]`
62               found reference `&[i32; 3]`
63
64 error[E0308]: mismatched types
65   --> $DIR/coerce-expect-unsized-ascribed.rs:18:27
66    |
67 LL |     let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]);
68    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
69    |
70    = note: expected reference `&[i32]`
71               found reference `&[i32; 3]`
72
73 error[E0308]: mismatched types
74   --> $DIR/coerce-expect-unsized-ascribed.rs:19:27
75    |
76 LL |     let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3, 4] }, &[i32]);
77    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
78    |
79    = note: expected reference `&[i32]`
80               found reference `&[i32; 3]`
81
82 error[E0308]: mismatched types
83   --> $DIR/coerce-expect-unsized-ascribed.rs:21:27
84    |
85 LL |     let _ = type_ascribe!(&{ |x| (x as u8) }, &dyn Fn(i32) -> _);
86    |                           ^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
87    |
88    = note: expected reference `&dyn Fn(i32) -> u8`
89               found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:30: 21:33]`
90
91 error[E0308]: mismatched types
92   --> $DIR/coerce-expect-unsized-ascribed.rs:22:27
93    |
94 LL |     let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug);
95    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool`
96    |
97    = note: expected reference `&dyn Debug`
98               found reference `&bool`
99
100 error[E0308]: mismatched types
101   --> $DIR/coerce-expect-unsized-ascribed.rs:23:27
102    |
103 LL |     let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn Debug);
104    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char`
105    |
106    = note: expected reference `&dyn Debug`
107               found reference `&char`
108
109 error[E0308]: mismatched types
110   --> $DIR/coerce-expect-unsized-ascribed.rs:25:27
111    |
112 LL |     let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>);
113    |                           ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
114    |
115    = note: expected struct `Box<[i32]>`
116               found struct `Box<[i32; 3]>`
117
118 error[E0308]: mismatched types
119   --> $DIR/coerce-expect-unsized-ascribed.rs:26:27
120    |
121 LL |     let _ = type_ascribe!(Box::new(|x| (x as u8)), Box<dyn Fn(i32) -> _>);
122    |                           ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
123    |
124    = note: expected struct `Box<dyn Fn(i32) -> u8>`
125               found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:36: 26:39]>`
126
127 error: aborting due to 14 previous errors
128
129 For more information about this error, try `rustc --explain E0308`.