Closed
Description
This issue seems to be specific to the Drop
trait.
#![feature(const_generics)]
#![feature(const_evaluatable_checked)]
#![allow(incomplete_features)]
struct Bar<const N: usize>
where [(); N - 1]:
{
x: [u8; N - 1]
}
impl<const N: usize> Drop for Bar<N>
where [(); N - 1]:
{
fn drop(&mut self) {
}
}
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 | | }
| |_^
rustc --version --verbose
:
rustc 1.50.0-nightly (fe982319a 2020-11-19)
binary: rustc
commit-hash: fe982319aa0aa5bbfc2795791a753832292bd2ba
commit-date: 2020-11-19
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly
@rustbot label A-const-generics F-const_evaluatable_checked T-compiler