diff --git a/components/script/dom/bindings/inheritance.rs b/components/script/dom/bindings/inheritance.rs index 06474fa5423..e0d4530704e 100644 --- a/components/script/dom/bindings/inheritance.rs +++ b/components/script/dom/bindings/inheritance.rs @@ -37,7 +37,7 @@ pub trait Castable: IDLInterface + DomObject + Sized { T: Castable, Self: DerivedFrom, { - unsafe { mem::transmute(self) } + unsafe { mem::transmute::<&Self, &T>(self) } } /// Cast a DOM object downwards to one of the interfaces it might implement.