Fix duplicate bounds for const_trait_impl
This commit is contained in:
parent
497ee321af
commit
a0b83f542f
2 changed files with 12 additions and 6 deletions
|
@ -16,12 +16,17 @@ impl const PartialEq for S {
|
|||
|
||||
// This duplicate bound should not result in ambiguities. It should be equivalent to a single ~const
|
||||
// bound.
|
||||
// const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool {
|
||||
// FIXME(fee1-dead)^ why should the order matter here?
|
||||
const fn equals_self<T: ~const PartialEq + PartialEq>(t: &T) -> bool {
|
||||
const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool {
|
||||
*t == *t
|
||||
}
|
||||
|
||||
pub const EQ: bool = equals_self(&S);
|
||||
trait A: PartialEq {}
|
||||
impl<T: PartialEq> A for T {}
|
||||
|
||||
const fn equals_self2<T: A + ~const PartialEq>(t: &T) -> bool {
|
||||
*t == *t
|
||||
}
|
||||
|
||||
pub const EQ: bool = equals_self(&S) && equals_self2(&S);
|
||||
|
||||
fn main() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue