summaryrefslogtreecommitdiffstats
path: root/tests/ui/coercion/coerce-expect-unsized-ascribed.stderr
blob: aa5ec6b5ae1fd82b1901a924d1b9f140a9d6190f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:9:27
   |
LL |     let _ = type_ascribe!(Box::new({ [1, 2, 3] }), Box<[i32]>);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
   |
   = note: expected struct `Box<[i32]>`
              found struct `Box<[i32; 3]>`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:10:27
   |
LL |     let _ = type_ascribe!(Box::new( if true { [1, 2, 3] } else { [1, 3, 4] }), Box<[i32]>);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
   |
   = note: expected struct `Box<[i32]>`
              found struct `Box<[i32; 3]>`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:12:9
   |
LL |         Box::new( match true { true => [1, 2, 3], false => [1, 3, 4] }), Box<[i32]>);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
   |
   = note: expected struct `Box<[i32]>`
              found struct `Box<[i32; 3]>`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:14:27
   |
LL |     let _ = type_ascribe!(Box::new( { |x| (x as u8) }), Box<dyn Fn(i32) -> _>);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:14:39]>`
   |
   = note: expected struct `Box<dyn Fn(i32) -> u8>`
              found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:14:39: 14:42]>`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:15:27
   |
LL |     let _ = type_ascribe!(Box::new( if true { false } else { true }), Box<dyn Debug>);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<bool>`
   |
   = note: expected struct `Box<dyn Debug>`
              found struct `Box<bool>`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:16:27
   |
LL |     let _ = type_ascribe!(Box::new( match true { true => 'a', false => 'b' }), Box<dyn Debug>);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<char>`
   |
   = note: expected struct `Box<dyn Debug>`
              found struct `Box<char>`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:18:27
   |
LL |     let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]);
   |                           ^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
   |
   = note: expected reference `&[i32]`
              found reference `&[i32; 3]`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:19:27
   |
LL |     let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
   |
   = note: expected reference `&[i32]`
              found reference `&[i32; 3]`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:20:27
   |
LL |     let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3, 4] }, &[i32]);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
   |
   = note: expected reference `&[i32]`
              found reference `&[i32; 3]`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:22:27
   |
LL |     let _ = type_ascribe!(&{ |x| (x as u8) }, &dyn Fn(i32) -> _);
   |                           ^^^^^^^^^^^^^^^^^^ expected `&dyn Fn(i32) -> u8`, found `&[closure@coerce-expect-unsized-ascribed.rs:22:30]`
   |
   = note: expected reference `&dyn Fn(i32) -> u8`
              found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:22:30: 22:33]`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:23:27
   |
LL |     let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&bool`
   |
   = note: expected reference `&dyn Debug`
              found reference `&bool`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:24:27
   |
LL |     let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn Debug);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&char`
   |
   = note: expected reference `&dyn Debug`
              found reference `&char`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:26:27
   |
LL |     let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>);
   |                           ^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
   |
   = note: expected struct `Box<[i32]>`
              found struct `Box<[i32; 3]>`

error[E0308]: mismatched types
  --> $DIR/coerce-expect-unsized-ascribed.rs:27:27
   |
LL |     let _ = type_ascribe!(Box::new(|x| (x as u8)), Box<dyn Fn(i32) -> _>);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:27:36]>`
   |
   = note: expected struct `Box<dyn Fn(i32) -> u8>`
              found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:27:36: 27:39]>`

error: aborting due to 14 previous errors

For more information about this error, try `rustc --explain E0308`.