Only allow ~const bounds for traits with #[const_trait]
This commit is contained in:
@@ -2,13 +2,18 @@
|
||||
|
||||
struct S;
|
||||
|
||||
impl PartialEq for S {
|
||||
#[const_trait]
|
||||
trait Foo {
|
||||
fn eq(&self, _: &Self) -> bool;
|
||||
}
|
||||
|
||||
impl Foo for S {
|
||||
fn eq(&self, _: &S) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
|
||||
const fn equals_self<T: ~const Foo>(t: &T) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user