File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use crate::hash::{Hash, Hasher};
55use crate :: intrinsics:: aggregate_raw_ptr;
66use crate :: intrinsics:: ptr_metadata;
77use crate :: marker:: Freeze ;
8+ use crate :: ptr:: NonNull ;
89
910/// Provides the pointer metadata type of any pointed-to type.
1011///
@@ -153,7 +154,7 @@ pub const fn from_raw_parts_mut<T: ?Sized>(
153154/// compare equal (since identical vtables can be deduplicated within a codegen unit).
154155#[ lang = "dyn_metadata" ]
155156pub struct DynMetadata < Dyn : ?Sized > {
156- _vtable_ptr : & ' static VTable ,
157+ _vtable_ptr : NonNull < VTable > ,
157158 _phantom : crate :: marker:: PhantomData < Dyn > ,
158159}
159160
@@ -174,7 +175,7 @@ impl<Dyn: ?Sized> DynMetadata<Dyn> {
174175 fn vtable_ptr ( self ) -> * const VTable {
175176 // SAFETY: this layout assumption is hard-coded into the compiler.
176177 // If it's somehow not a size match, the transmute will error.
177- unsafe { crate :: mem:: transmute :: < Self , & ' static VTable > ( self ) }
178+ unsafe { crate :: mem:: transmute :: < Self , * const VTable > ( self ) }
178179 }
179180
180181 /// Returns the size of the type associated with this vtable.
You can’t perform that action at this time.
0 commit comments