@@ -43,13 +43,10 @@ declare_lint! {
4343}
4444
4545/// FIXME: false negatives (i.e. the lint is not emitted when it should be)
46- /// 1. Method calls that are not checked for:
47- /// - [`temporary_unsafe_cell.get()`][`core::cell::UnsafeCell::get()`]
48- /// - [`temporary_sync_unsafe_cell.get()`][`core::cell::SyncUnsafeCell::get()`]
49- /// 2. Ways to get a temporary that are not recognized:
46+ /// 1. Ways to get a temporary that are not recognized:
5047/// - `owning_temporary.field`
5148/// - `owning_temporary[index]`
52- /// 3 . No checks for ref-to-ptr conversions:
49+ /// 2 . No checks for ref-to-ptr conversions:
5350/// - `&raw [mut] temporary`
5451/// - `&temporary as *(const|mut) _`
5552/// - `ptr::from_ref(&temporary)` and friends
@@ -200,8 +197,8 @@ fn is_temporary_rvalue(expr: &Expr<'_>) -> bool {
200197 }
201198}
202199
203- // Array, Vec, String, CString, MaybeUninit, Cell, Box<[_]>, Box<str>, Box<CStr>,
204- // or any of the above in arbitrary many nested Box'es.
200+ // Array, Vec, String, CString, MaybeUninit, Cell, Box<[_]>, Box<str>, Box<CStr>, UnsafeCell,
201+ // SyncUnsafeCell, or any of the above in arbitrary many nested Box'es.
205202fn owns_allocation ( tcx : TyCtxt < ' _ > , ty : Ty < ' _ > ) -> bool {
206203 if ty. is_array ( ) {
207204 true
@@ -217,7 +214,7 @@ fn owns_allocation(tcx: TyCtxt<'_>, ty: Ty<'_>) -> bool {
217214 }
218215 }
219216 tcx. get_diagnostic_name ( def. did ( ) ) . is_some_and ( |name| {
220- matches ! ( name, sym:: cstring_type | sym:: Vec | sym:: Cell | sym:: sync_unsafe_cell )
217+ matches ! ( name, sym:: cstring_type | sym:: Vec | sym:: Cell | sym:: SyncUnsafeCell )
221218 } )
222219 } else {
223220 false
0 commit comments