Recognize bounds on impls as const bounds

This commit is contained in:
Deadbeef 2021-07-19 18:50:47 +08:00
parent d05a286449
commit 4b82bbeac0
No known key found for this signature in database
GPG key ID: 6525773485376D92
4 changed files with 38 additions and 14 deletions

View file

@ -0,0 +1,15 @@
// check-pass
#![feature(const_fn_trait_bound)]
#![feature(const_trait_impl)]
trait MyPartialEq {
fn eq(&self, other: &Self) -> bool;
}
impl<T: PartialEq> const MyPartialEq for T {
fn eq(&self, other: &Self) -> bool {
PartialEq::eq(self, other)
}
}
fn main() {}