Skip to content

Commit

Permalink
Small fix and re-simplification
Browse files Browse the repository at this point in the history
I'm reverting the workaround here as I'm done with debugging for the time being.
This code currently trips a beta regression. See <rust-lang/rust#89190>.
  • Loading branch information
Tamschi committed Sep 29, 2021
1 parent eff73c3 commit 17da43d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ impl<'a> Display for dyn 'a + DyncastEq {
}
impl<'a> PartialEq for dyn 'a + DyncastEq {
fn eq(&self, other: &Self) -> bool {
unsafe{self.dyncast_::<dyn 'a + PartialEq<dyn 'a+DyncastEq>, dyn PartialEq<dyn DyncastEq>>()}
unsafe{self.dyncast_::<dyn 'a + PartialEq<dyn 'a + Dyncast>, dyn PartialEq<dyn Dyncast>>()}
.expect("Expected `Self` to be *dynamically* `dyn PartialEq<dyn Dyncast>` via `dyn DyncastOrd: PartialOrd`")
.eq(other)
}
Expand Down Expand Up @@ -798,15 +798,15 @@ impl<'a> Display for dyn 'a + DyncastOrd {
}
impl<'a> PartialEq for dyn 'a + DyncastOrd {
fn eq(&self, other: &Self) -> bool {
self.as_dyncast_eq().eq(other.as_dyncast_eq())
self.as_dyncast_eq().eq(other)
}
}
impl<'a> Eq for dyn 'a + DyncastOrd {}
impl<'a> PartialOrd for dyn 'a + DyncastOrd {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
unsafe{self.dyncast_::<dyn 'a+PartialOrd<dyn 'a+Dyncast>,dyn PartialOrd<dyn Dyncast>>()}
.expect("Expected `Self` to be *dynamically* `dyn PartialOrd<dyn Dyncast>` via `dyn DyncastOrd: PartialOrd`")
.partial_cmp(other.as_dyncast())
.partial_cmp(other)
}
}
impl<'a> Ord for dyn 'a + DyncastOrd {
Expand Down

0 comments on commit 17da43d

Please sign in to comment.