-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking issue for future-incompatibility lint ptr_cast_add_auto_to_object #127323
Copy link
Copy link
Closed
Labels
A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-raw-pointersArea: raw pointers, MaybeUninit, NonNullArea: raw pointers, MaybeUninit, NonNullC-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-arbitrary_self_types`#![feature(arbitrary_self_types)]``#![feature(arbitrary_self_types)]`F-derive_coerce_pointeeFeature: RFC 3621's oft-renamed implementationFeature: RFC 3621's oft-renamed implementationT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-raw-pointersArea: raw pointers, MaybeUninit, NonNullArea: raw pointers, MaybeUninit, NonNullC-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-arbitrary_self_types`#![feature(arbitrary_self_types)]``#![feature(arbitrary_self_types)]`F-derive_coerce_pointeeFeature: RFC 3621's oft-renamed implementationFeature: RFC 3621's oft-renamed implementationT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is a tracking issue for the
ptr_cast_add_auto_to_objectlint, 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: