Require Drop impls to have the same constness on its bounds as the bounds on the struct have
This commit is contained in:
parent
349ba6bb51
commit
d6cf8934db
6 changed files with 118 additions and 55 deletions
|
@ -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() {}
|
Loading…
Add table
Add a link
Reference in a new issue