From 97e1b8242e71b1c78b826c0526dcecbb31e10a99 Mon Sep 17 00:00:00 2001 From: gavincrawford <94875769+gavincrawford@users.noreply.github.com> Date: Tue, 12 Nov 2024 22:32:13 -0700 Subject: [PATCH] Correct sync_unsafe_cell to camel case --- compiler/rustc_lint/src/dangling.rs | 6 +++--- compiler/rustc_span/src/symbol.rs | 2 +- library/core/src/cell.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_lint/src/dangling.rs b/compiler/rustc_lint/src/dangling.rs index 21966758b106..574785bc3959 100644 --- a/compiler/rustc_lint/src/dangling.rs +++ b/compiler/rustc_lint/src/dangling.rs @@ -200,8 +200,8 @@ fn is_temporary_rvalue(expr: &Expr<'_>) -> bool { } } -// Array, Vec, String, CString, MaybeUninit, Cell, Box<[_]>, Box, Box, -// or any of the above in arbitrary many nested Box'es. +// Array, Vec, String, CString, MaybeUninit, Cell, Box<[_]>, Box, Box, UnsafeCell, +// SyncUnsafeCell, or any of the above in arbitrary many nested Box'es. fn owns_allocation(tcx: TyCtxt<'_>, ty: Ty<'_>) -> bool { if ty.is_array() { true @@ -217,7 +217,7 @@ fn owns_allocation(tcx: TyCtxt<'_>, ty: Ty<'_>) -> bool { } } tcx.get_diagnostic_name(def.did()).is_some_and(|name| { - matches!(name, sym::cstring_type | sym::Vec | sym::Cell | sym::sync_unsafe_cell) + matches!(name, sym::cstring_type | sym::Vec | sym::Cell | sym::SyncUnsafeCell) }) } else { false diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index dd969831253f..a7c43a208402 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -316,6 +316,7 @@ symbols! { SubdiagMessage, Subdiagnostic, Sync, + SyncUnsafeCell, T, Target, ToOwned, @@ -1929,7 +1930,6 @@ symbols! { surface_async_drop_in_place, sym, sync, - sync_unsafe_cell, synthetic, t32, target, diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index e595ea56392b..20904c9bc761 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -2273,7 +2273,7 @@ impl, U> DispatchFromDyn> for UnsafeCell /// See [`UnsafeCell`] for details. #[unstable(feature = "sync_unsafe_cell", issue = "95439")] #[repr(transparent)] -#[rustc_diagnostic_item = "sync_unsafe_cell"] +#[rustc_diagnostic_item = "SyncUnsafeCell"] #[rustc_pub_transparent] pub struct SyncUnsafeCell { value: UnsafeCell,