diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint/src/dangling.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/dangling.rs b/compiler/rustc_lint/src/dangling.rs index 09fe709e845..21966758b10 100644 --- a/compiler/rustc_lint/src/dangling.rs +++ b/compiler/rustc_lint/src/dangling.rs @@ -211,13 +211,14 @@ fn owns_allocation(tcx: TyCtxt<'_>, ty: Ty<'_>) -> bool { || inner.ty_adt_def().is_some_and(|def| tcx.is_lang_item(def.did(), LangItem::CStr)) || owns_allocation(tcx, inner) } else if let Some(def) = ty.ty_adt_def() { - for lang_item in [LangItem::String, LangItem::MaybeUninit] { + for lang_item in [LangItem::String, LangItem::MaybeUninit, LangItem::UnsafeCell] { if tcx.is_lang_item(def.did(), lang_item) { return true; } } - tcx.get_diagnostic_name(def.did()) - .is_some_and(|name| matches!(name, sym::cstring_type | sym::Vec | sym::Cell)) + tcx.get_diagnostic_name(def.did()).is_some_and(|name| { + matches!(name, sym::cstring_type | sym::Vec | sym::Cell | sym::sync_unsafe_cell) + }) } else { false } diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index dde6b83c151..786be851c5d 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1930,6 +1930,7 @@ symbols! { surface_async_drop_in_place, sym, sync, + sync_unsafe_cell, synthetic, t32, target, |
