From 68c05e7c628a0ae70996637507753e103a03aa95 Mon Sep 17 00:00:00 2001 From: crabm4n Date: Thu, 9 May 2024 14:46:58 +0000 Subject: [PATCH 1/2] changes for toolchain upgrade --- src/meta.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meta.rs b/src/meta.rs index 5982ecc..7367f2a 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -399,7 +399,7 @@ impl MetaTable { { let ty_id = TypeId::of::(); // use self.addr() for unpredictable address to use for checking consistency below - let invalid_ptr = core::ptr::invalid_mut::((self as *mut Self).addr()); + let invalid_ptr = core::ptr::without_provenance_mut::((self as *mut Self).addr()); let trait_ptr = >::cast(invalid_ptr); // assert that address not changed (to catch some mistakes in CastFrom impl) assert_eq!( From 57457d93809235e44fd6a7221cfda5896d1a4a73 Mon Sep 17 00:00:00 2001 From: crabm4n Date: Thu, 9 May 2024 15:03:59 +0000 Subject: [PATCH 2/2] clippyyy --- src/meta.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meta.rs b/src/meta.rs index 7367f2a..1a0ec39 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -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(value: *mut ()) -> *mut TraitObject +fn attach_vtable(value: *mut ()) -> *mut TraitObject where - TraitObject: CastFrom + 'static, + TraitObject: CastFrom + 'static + ?Sized, T: core::any::Any, { // NOTE: This should be equivalent to `Any::downcast_ref_unchecked` except