@@ -11,6 +11,122 @@ LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from
11
11
found type parameter `I`
12
12
= note: required because of the requirements on the impl of `Iterator` for `Map<Rev<std::ops::Range<u8>>, [closure@$DIR/issue-60564.rs:20:28: 20:100]>`
13
13
14
+ error[E0271]: type mismatch resolving `<T as TryInto<u8>>::Error == E`
15
+ --> $DIR/issue-60564.rs:20:9
16
+ |
17
+ LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I>;
18
+ | - this type parameter
19
+ ...
20
+ LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
21
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `E`, found enum `Infallible`
22
+ |
23
+ = note: expected type parameter `E`
24
+ found enum `Infallible`
25
+ note: required by a bound in `<T as IterBits>`
26
+ --> $DIR/issue-60564.rs:15:37
27
+ |
28
+ LL | + std::convert::TryInto<u8, Error = E>,
29
+ | ^^^^^^^^^ required by this bound in `<T as IterBits>`
30
+
31
+ error[E0277]: no implementation for `T >> T`
32
+ --> $DIR/issue-60564.rs:20:9
33
+ |
34
+ LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
35
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `T >> T`
36
+ |
37
+ note: required by a bound in `<T as IterBits>`
38
+ --> $DIR/issue-60564.rs:12:8
39
+ |
40
+ LL | T: std::ops::Shr<Output = T>
41
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<T as IterBits>`
42
+ help: consider restricting type parameter `T`
43
+ |
44
+ LL | type IterBitsIter<T: std::ops::Shr, E, I> = impl std::iter::Iterator<Item = I>;
45
+ | +++++++++++++++
46
+
47
+ error[E0277]: no implementation for `T & T`
48
+ --> $DIR/issue-60564.rs:20:9
49
+ |
50
+ LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
51
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `T & T`
52
+ |
53
+ note: required by a bound in `<T as IterBits>`
54
+ --> $DIR/issue-60564.rs:13:11
55
+ |
56
+ LL | + std::ops::BitAnd<T, Output = T>
57
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<T as IterBits>`
58
+ help: consider restricting type parameter `T`
59
+ |
60
+ LL | type IterBitsIter<T: std::ops::BitAnd, E, I> = impl std::iter::Iterator<Item = I>;
61
+ | ++++++++++++++++++
62
+
63
+ error[E0277]: the trait bound `T: From<u8>` is not satisfied
64
+ --> $DIR/issue-60564.rs:20:9
65
+ |
66
+ LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
67
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<u8>` is not implemented for `T`
68
+ |
69
+ note: required by a bound in `<T as IterBits>`
70
+ --> $DIR/issue-60564.rs:14:11
71
+ |
72
+ LL | + std::convert::From<u8>
73
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<T as IterBits>`
74
+ help: consider restricting type parameter `T`
75
+ |
76
+ LL | type IterBitsIter<T: std::convert::From<u8>, E, I> = impl std::iter::Iterator<Item = I>;
77
+ | ++++++++++++++++++++++++
78
+
79
+ error[E0277]: the trait bound `T: Copy` is not satisfied
80
+ --> $DIR/issue-60564.rs:20:9
81
+ |
82
+ LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
83
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
84
+ |
85
+ note: required by a bound in `<T as IterBits>`
86
+ --> $DIR/issue-60564.rs:10:9
87
+ |
88
+ LL | impl<T: Copy, E> IterBits for T
89
+ | ^^^^ required by this bound in `<T as IterBits>`
90
+ help: consider restricting type parameter `T`
91
+ |
92
+ LL | type IterBitsIter<T: std::marker::Copy, E, I> = impl std::iter::Iterator<Item = I>;
93
+ | +++++++++++++++++++
94
+
95
+ error[E0277]: `E` doesn't implement `Debug`
96
+ --> $DIR/issue-60564.rs:20:9
97
+ |
98
+ LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
99
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `E` cannot be formatted using `{:?}` because it doesn't implement `Debug`
100
+ |
101
+ note: required by a bound in `<T as IterBits>`
102
+ --> $DIR/issue-60564.rs:16:8
103
+ |
104
+ LL | E: std::fmt::Debug,
105
+ | ^^^^^^^^^^^^^^^ required by this bound in `<T as IterBits>`
106
+ help: consider restricting type parameter `E`
107
+ |
108
+ LL | type IterBitsIter<T, E: std::fmt::Debug, I> = impl std::iter::Iterator<Item = I>;
109
+ | +++++++++++++++++
110
+
111
+ error[E0277]: the trait bound `u8: From<T>` is not satisfied
112
+ --> $DIR/issue-60564.rs:20:9
113
+ |
114
+ LL | (0u8..n).rev().map(move |shift| ((self >> T::from(shift)) & T::from(1)).try_into().unwrap())
115
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<T>` is not implemented for `u8`
116
+ |
117
+ = note: required because of the requirements on the impl of `Into<u8>` for `T`
118
+ = note: required because of the requirements on the impl of `TryFrom<T>` for `u8`
119
+ = note: required because of the requirements on the impl of `TryInto<u8>` for `T`
120
+ note: required by a bound in `<T as IterBits>`
121
+ --> $DIR/issue-60564.rs:15:11
122
+ |
123
+ LL | + std::convert::TryInto<u8, Error = E>,
124
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `<T as IterBits>`
125
+ help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
126
+ |
127
+ LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I> where u8: From<T>;
128
+ | +++++++++++++++++
129
+
14
130
error: non-defining opaque type use in defining scope
15
131
--> $DIR/issue-60564.rs:20:9
16
132
|
@@ -23,6 +139,7 @@ note: used non-generic type `u8` for generic parameter
23
139
LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I>;
24
140
| ^
25
141
26
- error: aborting due to 2 previous errors
142
+ error: aborting due to 9 previous errors
27
143
28
- For more information about this error, try `rustc --explain E0271`.
144
+ Some errors have detailed explanations: E0271, E0277.
145
+ For more information about an error, try `rustc --explain E0271`.
0 commit comments