Skip to content

Commit

Permalink
Merge pull request #236 from crabm4n/crab/toolchain-upgrade
Browse files Browse the repository at this point in the history
Fix compilation on latest nightly
  • Loading branch information
Imberflur committed May 9, 2024
2 parents d4c78c2 + 57457d9 commit 486829c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ where
/// We exclusively operate on pointers here so we only need a single function
/// pointer in the meta-table for both `&T` and `&mut T` cases.
#[cfg(not(feature = "nightly"))]
fn attach_vtable<TraitObject: ?Sized, T>(value: *mut ()) -> *mut TraitObject
fn attach_vtable<TraitObject, T>(value: *mut ()) -> *mut TraitObject
where
TraitObject: CastFrom<T> + 'static,
TraitObject: CastFrom<T> + 'static + ?Sized,
T: core::any::Any,
{
// NOTE: This should be equivalent to `Any::downcast_ref_unchecked` except
Expand Down Expand Up @@ -399,7 +399,7 @@ impl<T: ?Sized> MetaTable<T> {
{
let ty_id = TypeId::of::<R>();
// use self.addr() for unpredictable address to use for checking consistency below
let invalid_ptr = core::ptr::invalid_mut::<R>((self as *mut Self).addr());
let invalid_ptr = core::ptr::without_provenance_mut::<R>((self as *mut Self).addr());
let trait_ptr = <T as CastFrom<R>>::cast(invalid_ptr);
// assert that address not changed (to catch some mistakes in CastFrom impl)
assert_eq!(
Expand Down

0 comments on commit 486829c

Please sign in to comment.