We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
UnsafeCell
1 parent 5483a7d commit 6293da2Copy full SHA for 6293da2
clippy_lints/src/non_copy_const.rs
@@ -148,7 +148,7 @@ fn is_value_unfrozen_raw<'tcx>(
148
match val.ty().kind() {
149
// the fact that we have to dig into every structs to search enums
150
// leads us to the point checking `UnsafeCell` directly is the only option.
151
- ty::Adt(ty_def, ..) if Some(ty_def.did()) == cx.tcx.lang_items().unsafe_cell_type() => true,
+ ty::Adt(ty_def, ..) if ty_def.is_unsafe_cell() => true,
152
ty::Array(..) | ty::Adt(..) | ty::Tuple(..) => {
153
let val = cx.tcx.destructure_mir_constant(cx.param_env, val);
154
val.fields.iter().any(|field| inner(cx, *field))
0 commit comments