]> git.proxmox.com Git - rustc.git/blob - src/test/ui/associated-type-bounds/inside-adt.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / associated-type-bounds / inside-adt.stderr
1 error: associated type bounds are not allowed within structs, enums, or unions
2 --> $DIR/inside-adt.rs:5:29
3 |
4 LL | struct S1 { f: dyn Iterator<Item: Copy> }
5 | ^^^^^^^^^^
6
7 error: associated type bounds are not allowed within structs, enums, or unions
8 --> $DIR/inside-adt.rs:7:33
9 |
10 LL | struct S2 { f: Box<dyn Iterator<Item: Copy>> }
11 | ^^^^^^^^^^
12
13 error: associated type bounds are not allowed within structs, enums, or unions
14 --> $DIR/inside-adt.rs:9:29
15 |
16 LL | struct S3 { f: dyn Iterator<Item: 'static> }
17 | ^^^^^^^^^^^^^
18
19 error: associated type bounds are not allowed within structs, enums, or unions
20 --> $DIR/inside-adt.rs:12:26
21 |
22 LL | enum E1 { V(dyn Iterator<Item: Copy>) }
23 | ^^^^^^^^^^
24
25 error: associated type bounds are not allowed within structs, enums, or unions
26 --> $DIR/inside-adt.rs:15:30
27 |
28 LL | enum E2 { V(Box<dyn Iterator<Item: Copy>>) }
29 | ^^^^^^^^^^
30
31 error: associated type bounds are not allowed within structs, enums, or unions
32 --> $DIR/inside-adt.rs:17:26
33 |
34 LL | enum E3 { V(dyn Iterator<Item: 'static>) }
35 | ^^^^^^^^^^^^^
36
37 error: associated type bounds are not allowed within structs, enums, or unions
38 --> $DIR/inside-adt.rs:21:41
39 |
40 LL | union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
41 | ^^^^^^^^^^
42
43 error: associated type bounds are not allowed within structs, enums, or unions
44 --> $DIR/inside-adt.rs:24:45
45 |
46 LL | union U2 { f: ManuallyDrop<Box<dyn Iterator<Item: Copy>>> }
47 | ^^^^^^^^^^
48
49 error: associated type bounds are not allowed within structs, enums, or unions
50 --> $DIR/inside-adt.rs:26:41
51 |
52 LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
53 | ^^^^^^^^^^^^^
54
55 error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time
56 --> $DIR/inside-adt.rs:12:13
57 |
58 LL | enum E1 { V(dyn Iterator<Item: Copy>) }
59 | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
60 |
61 = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)`
62 = note: no field of an enum variant may have a dynamically sized type
63 = help: change the field's type to have a statically known size
64 help: borrowed types always have a statically known size
65 |
66 LL | enum E1 { V(&dyn Iterator<Item: Copy>) }
67 | +
68 help: the `Box` type always has a statically known size and allocates its contents in the heap
69 |
70 LL | enum E1 { V(Box<dyn Iterator<Item: Copy>>) }
71 | ++++ +
72
73 error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` cannot be known at compilation time
74 --> $DIR/inside-adt.rs:17:13
75 |
76 LL | enum E3 { V(dyn Iterator<Item: 'static>) }
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
78 |
79 = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
80 = note: no field of an enum variant may have a dynamically sized type
81 = help: change the field's type to have a statically known size
82 help: borrowed types always have a statically known size
83 |
84 LL | enum E3 { V(&dyn Iterator<Item: 'static>) }
85 | +
86 help: the `Box` type always has a statically known size and allocates its contents in the heap
87 |
88 LL | enum E3 { V(Box<dyn Iterator<Item: 'static>>) }
89 | ++++ +
90
91 error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time
92 --> $DIR/inside-adt.rs:21:15
93 |
94 LL | union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
96 |
97 = help: within `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)`
98 = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`
99 = note: no field of a union may have a dynamically sized type
100 = help: change the field's type to have a statically known size
101 help: borrowed types always have a statically known size
102 |
103 LL | union U1 { f: &ManuallyDrop<dyn Iterator<Item: Copy>> }
104 | +
105 help: the `Box` type always has a statically known size and allocates its contents in the heap
106 |
107 LL | union U1 { f: Box<ManuallyDrop<dyn Iterator<Item: Copy>>> }
108 | ++++ +
109
110 error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` cannot be known at compilation time
111 --> $DIR/inside-adt.rs:26:15
112 |
113 LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
114 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
115 |
116 = help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
117 = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`
118 = note: no field of a union may have a dynamically sized type
119 = help: change the field's type to have a statically known size
120 help: borrowed types always have a statically known size
121 |
122 LL | union U3 { f: &ManuallyDrop<dyn Iterator<Item: 'static>> }
123 | +
124 help: the `Box` type always has a statically known size and allocates its contents in the heap
125 |
126 LL | union U3 { f: Box<ManuallyDrop<dyn Iterator<Item: 'static>>> }
127 | ++++ +
128
129 error: aborting due to 13 previous errors
130
131 For more information about this error, try `rustc --explain E0277`.