@@ -43,13 +43,10 @@ declare_lint! {
43
43
}
44
44
45
45
/// 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:
50
47
/// - `owning_temporary.field`
51
48
/// - `owning_temporary[index]`
52
- /// 3 . No checks for ref-to-ptr conversions:
49
+ /// 2 . No checks for ref-to-ptr conversions:
53
50
/// - `&raw [mut] temporary`
54
51
/// - `&temporary as *(const|mut) _`
55
52
/// - `ptr::from_ref(&temporary)` and friends
@@ -200,8 +197,8 @@ fn is_temporary_rvalue(expr: &Expr<'_>) -> bool {
200
197
}
201
198
}
202
199
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.
205
202
fn owns_allocation ( tcx : TyCtxt < ' _ > , ty : Ty < ' _ > ) -> bool {
206
203
if ty. is_array ( ) {
207
204
true
@@ -217,7 +214,7 @@ fn owns_allocation(tcx: TyCtxt<'_>, ty: Ty<'_>) -> bool {
217
214
}
218
215
}
219
216
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 )
221
218
} )
222
219
} else {
223
220
false
0 commit comments