1
Fork 0

Require Drop impls to have the same constness on its bounds as the bounds on the struct have

This commit is contained in:
Oli Scherer 2022-10-21 13:49:11 +00:00
parent 349ba6bb51
commit d6cf8934db
6 changed files with 118 additions and 55 deletions

View file

@ -0,0 +1,17 @@
// check-pass
#![feature(const_trait_impl)]
#[const_trait]
trait Foo {
fn foo(&self) {}
}
struct Bar<T>(T);
impl<T: ~const Foo> Bar<T> {
const fn foo(&self) {
self.0.foo()
}
}
fn main() {}