summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-type-bounds/inside-adt.stderr
blob: dbfcfa5806309c0be12cf5cf55b2c5e23b1f953a (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
130
131
error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:5:29
   |
LL | struct S1 { f: dyn Iterator<Item: Copy> }
   |                             ^^^^^^^^^^

error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:7:33
   |
LL | struct S2 { f: Box<dyn Iterator<Item: Copy>> }
   |                                 ^^^^^^^^^^

error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:9:29
   |
LL | struct S3 { f: dyn Iterator<Item: 'static> }
   |                             ^^^^^^^^^^^^^

error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:12:26
   |
LL | enum E1 { V(dyn Iterator<Item: Copy>) }
   |                          ^^^^^^^^^^

error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:15:30
   |
LL | enum E2 { V(Box<dyn Iterator<Item: Copy>>) }
   |                              ^^^^^^^^^^

error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:17:26
   |
LL | enum E3 { V(dyn Iterator<Item: 'static>) }
   |                          ^^^^^^^^^^^^^

error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:21:41
   |
LL | union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
   |                                         ^^^^^^^^^^

error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:24:45
   |
LL | union U2 { f: ManuallyDrop<Box<dyn Iterator<Item: Copy>>> }
   |                                             ^^^^^^^^^^

error: associated type bounds are not allowed within structs, enums, or unions
  --> $DIR/inside-adt.rs:26:41
   |
LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
   |                                         ^^^^^^^^^^^^^

error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time
  --> $DIR/inside-adt.rs:12:13
   |
LL | enum E1 { V(dyn Iterator<Item: Copy>) }
   |             ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)`
   = note: no field of an enum variant may have a dynamically sized type
   = help: change the field's type to have a statically known size
help: borrowed types always have a statically known size
   |
LL | enum E1 { V(&dyn Iterator<Item: Copy>) }
   |             +
help: the `Box` type always has a statically known size and allocates its contents in the heap
   |
LL | enum E1 { V(Box<dyn Iterator<Item: Copy>>) }
   |             ++++                        +

error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` cannot be known at compilation time
  --> $DIR/inside-adt.rs:17:13
   |
LL | enum E3 { V(dyn Iterator<Item: 'static>) }
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
   = note: no field of an enum variant may have a dynamically sized type
   = help: change the field's type to have a statically known size
help: borrowed types always have a statically known size
   |
LL | enum E3 { V(&dyn Iterator<Item: 'static>) }
   |             +
help: the `Box` type always has a statically known size and allocates its contents in the heap
   |
LL | enum E3 { V(Box<dyn Iterator<Item: 'static>>) }
   |             ++++                           +

error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time
  --> $DIR/inside-adt.rs:21:15
   |
LL | union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: within `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)`
   = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`
   = note: no field of a union may have a dynamically sized type
   = help: change the field's type to have a statically known size
help: borrowed types always have a statically known size
   |
LL | union U1 { f: &ManuallyDrop<dyn Iterator<Item: Copy>> }
   |               +
help: the `Box` type always has a statically known size and allocates its contents in the heap
   |
LL | union U1 { f: Box<ManuallyDrop<dyn Iterator<Item: Copy>>> }
   |               ++++                                      +

error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` cannot be known at compilation time
  --> $DIR/inside-adt.rs:26:15
   |
LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
   = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`
   = note: no field of a union may have a dynamically sized type
   = help: change the field's type to have a statically known size
help: borrowed types always have a statically known size
   |
LL | union U3 { f: &ManuallyDrop<dyn Iterator<Item: 'static>> }
   |               +
help: the `Box` type always has a statically known size and allocates its contents in the heap
   |
LL | union U3 { f: Box<ManuallyDrop<dyn Iterator<Item: 'static>>> }
   |               ++++                                         +

error: aborting due to 13 previous errors

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