Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation on latest nightly #236

Merged
merged 2 commits into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading