Skip to content

Commit

Permalink
Correct sync_unsafe_cell to camel case
Browse files Browse the repository at this point in the history
  • Loading branch information
gavincrawford committed Nov 13, 2024
1 parent 24cc924 commit 97e1b82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_lint/src/dangling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ fn is_temporary_rvalue(expr: &Expr<'_>) -> bool {
}
}

// Array, Vec, String, CString, MaybeUninit, Cell, Box<[_]>, Box<str>, Box<CStr>,
// or any of the above in arbitrary many nested Box'es.
// Array, Vec, String, CString, MaybeUninit, Cell, Box<[_]>, Box<str>, Box<CStr>, 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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ symbols! {
SubdiagMessage,
Subdiagnostic,
Sync,
SyncUnsafeCell,
T,
Target,
ToOwned,
Expand Down Expand Up @@ -1929,7 +1930,6 @@ symbols! {
surface_async_drop_in_place,
sym,
sync,
sync_unsafe_cell,
synthetic,
t32,
target,
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2273,7 +2273,7 @@ impl<T: DispatchFromDyn<U>, U> DispatchFromDyn<UnsafeCell<U>> for UnsafeCell<T>
/// 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<T: ?Sized> {
value: UnsafeCell<T>,
Expand Down

0 comments on commit 97e1b82

Please sign in to comment.