Open WaffleLapkin opened 4 days ago
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:
Future compatibility warnings are generally made hard errors after a while, right? I don't think we should suggest suppressing a future compatibility warning.
@bjorn3 we only will make cases with the warning into errors. transmute
ing is, and will be, allowed (although you do actually need to make sure that your code is sound).
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: