You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't implement Drop on type with const_evaluatable_checked where bound #79248
error[E0367]: `Drop` impl requires `[(); _]: '<empty>` but the struct it is implemented for does not
--> src/lib.rs:12:11
|
12 | where [(); N - 1]:
| ^^^^^^^^^^^
|
note: the implementor must specify the same requirement
--> src/lib.rs:5:1
|
5 | / struct Bar<const N: usize>
6 | | where [(); N - 1]:
7 | | {
8 | | x: [u8; N - 1]
9 | | }
| |_^
error[E0367]: `Drop` impl requires `the constant `<Bar<N> as Drop>::{constant#0}` can be evaluated` but the struct it is implemented for does not
--> src/lib.rs:12:16
|
12 | where [(); N - 1]:
| ^^^^^
|
note: the implementor must specify the same requirement
--> src/lib.rs:5:1
|
5 | / struct Bar<const N: usize>
6 | | where [(); N - 1]:
7 | | {
8 | | x: [u8; N - 1]
9 | | }
| |_^
Activity
tgnottingham commentedon Nov 20, 2020
Also, is it expected that the where bounds need to be repeated in each of the type's trait impls?
memoryruins commentedon Nov 29, 2020
Yes, bounds on type definitions need to be repeated in impls, at least until implied bounds are introduced.
3541 commentedon Jul 6, 2021
Is anyone aware of a way to work around this issue at the moment?