Fix: Add missing transmute annotations in Castable trait (#33729)

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
chickenleaf 2024-10-08 22:07:05 +05:30 committed by GitHub
parent e8e51b1373
commit bc84dfbae5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,7 @@ pub trait Castable: IDLInterface + DomObject + Sized {
T: Castable,
Self: DerivedFrom<T>,
{
unsafe { mem::transmute(self) }
unsafe { mem::transmute::<&Self, &T>(self) }
}
/// Cast a DOM object downwards to one of the interfaces it might implement.