Skip to content

Commit 73a6240

Browse files
authored
Rollup merge of rust-lang#99011 - oli-obk:UnsoundCell, r=eddyb
`UnsafeCell` blocks niches inside its nested type from being available outside fixes rust-lang#87341 This implements the plan by `@eddyb` in rust-lang#87341 (comment) Somewhat related PR (not strictly necessary, but that cleanup made this PR simpler): rust-lang#94527
2 parents 9e1af3f + 6293da2 commit 73a6240

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/non_copy_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn is_value_unfrozen_raw<'tcx>(
148148
match val.ty().kind() {
149149
// the fact that we have to dig into every structs to search enums
150150
// 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,
151+
ty::Adt(ty_def, ..) if ty_def.is_unsafe_cell() => true,
152152
ty::Array(..) | ty::Adt(..) | ty::Tuple(..) => {
153153
let val = cx.tcx.destructure_mir_constant(cx.param_env, val);
154154
val.fields.iter().any(|field| inner(cx, *field))

0 commit comments

Comments
 (0)