1
Fork 0

Rollup merge of #132732 - gavincrawford:as_ptr_attribute, r=Urgau

Use attributes for `dangling_pointers_from_temporaries` lint

Checking for dangling pointers by function name isn't ideal, and leaves out certain pointer-returning methods that don't follow the `as_ptr` naming convention. Using an attribute for this lint cleans things up and allows more thorough coverage of other methods, such as `UnsafeCell::get()`.
This commit is contained in:
Jacob Pratt 2024-11-20 01:54:24 -05:00 committed by GitHub
commit 25dc4d0394
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 83 additions and 32 deletions

View file

@ -316,6 +316,7 @@ symbols! {
SubdiagMessage,
Subdiagnostic,
Sync,
SyncUnsafeCell,
T,
Target,
ToOwned,
@ -409,7 +410,6 @@ symbols! {
arm,
arm_target_feature,
array,
as_mut_ptr,
as_ptr,
as_ref,
as_str,
@ -1655,6 +1655,7 @@ symbols! {
rustc_allow_const_fn_unstable,
rustc_allow_incoherent_impl,
rustc_allowed_through_unstable_modules,
rustc_as_ptr,
rustc_attrs,
rustc_autodiff,
rustc_box,