mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Disambiguate trait object reference syntax.
This commit is contained in:
parent
121904dd89
commit
76b8810a86
3 changed files with 31 additions and 31 deletions
|
@ -25,7 +25,7 @@ pub trait Actor : Any {
|
|||
fn name(&self) -> String;
|
||||
}
|
||||
|
||||
impl<'a> AnyMutRefExt<'a> for &'a mut Actor + 'a {
|
||||
impl<'a> AnyMutRefExt<'a> for &'a mut (Actor + 'a) {
|
||||
fn downcast_mut<T: 'static>(self) -> Option<&'a mut T> {
|
||||
if self.is::<T>() {
|
||||
unsafe {
|
||||
|
@ -41,7 +41,7 @@ impl<'a> AnyMutRefExt<'a> for &'a mut Actor + 'a {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> AnyRefExt<'a> for &'a Actor + 'a {
|
||||
impl<'a> AnyRefExt<'a> for &'a (Actor + 'a) {
|
||||
fn is<T: 'static>(self) -> bool {
|
||||
// This implementation is only needed so long as there's a Rust bug that
|
||||
// prevents downcast_ref from giving realistic return values.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue