Skip to content

Commit 854948a

Browse files
committed
Convert two missed places
1 parent 432ff5e commit 854948a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/tools/clippy/clippy_lints/src/operators/ptr_eq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn expr_as_cast_to_usize<'tcx>(cx: &LateContext<'tcx>, cast_expr: &'tcx Expr<'_>
5353
// If the given expression is a cast to a `*const` pointer, return the lhs of the cast
5454
// E.g., `foo as *const _` returns `foo`.
5555
fn expr_as_cast_to_raw_pointer<'tcx>(cx: &LateContext<'tcx>, cast_expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> {
56-
if cx.typeck_results().expr_ty(cast_expr).is_unsafe_ptr() {
56+
if cx.typeck_results().expr_ty(cast_expr).is_raw_ptr() {
5757
if let ExprKind::Cast(expr, _) = cast_expr.kind {
5858
return Some(expr);
5959
}

Diff for: src/tools/clippy/clippy_lints/src/swap_ptr_to_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl LateLintPass<'_> for SwapPtrToRef {
7676
fn is_ptr_to_ref(cx: &LateContext<'_>, e: &Expr<'_>, ctxt: SyntaxContext) -> (bool, Option<Span>) {
7777
if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, borrowed_expr) = e.kind
7878
&& let ExprKind::Unary(UnOp::Deref, derefed_expr) = borrowed_expr.kind
79-
&& cx.typeck_results().expr_ty(derefed_expr).is_unsafe_ptr()
79+
&& cx.typeck_results().expr_ty(derefed_expr).is_raw_ptr()
8080
{
8181
(
8282
true,

0 commit comments

Comments
 (0)