Tracking Issue for ptr_cast_add_auto_to_object
future compatibility warning
#127323
Labels
A-raw-pointers
Area: raw pointers, MaybeUninit, NonNull
A-trait-objects
Area: trait objects, vtable layout
C-future-compatibility
Category: Future-compatibility lints
C-tracking-issue
Category: A tracking issue for an RFC or an unstable feature.
This is a tracking issue for the
ptr_cast_add_auto_to_object
lint, which was added in #120248.This lint detects casts of raw pointers to trait objects, which add auto traits. Adding auto traits to trait objects may cause UB when
#![feature(arbitrary_self_types)]
is used.Example
In case your usage is sound (e.g. because the trait doesn't have auto trait bounds), you can replace cast with a transmute to suppress the warning:
The text was updated successfully, but these errors were encountered: