Skip to content

Commit

Permalink
Convert two missed places
Browse files Browse the repository at this point in the history
  • Loading branch information
1c3t3a committed Feb 10, 2025
1 parent 91ff190 commit 15d08ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/operators/ptr_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn expr_as_cast_to_usize<'tcx>(cx: &LateContext<'tcx>, cast_expr: &'tcx Expr<'_>
// If the given expression is a cast to a `*const` pointer, return the lhs of the cast
// E.g., `foo as *const _` returns `foo`.
fn expr_as_cast_to_raw_pointer<'tcx>(cx: &LateContext<'tcx>, cast_expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> {
if cx.typeck_results().expr_ty(cast_expr).is_unsafe_ptr() {
if cx.typeck_results().expr_ty(cast_expr).is_raw_ptr() {
if let ExprKind::Cast(expr, _) = cast_expr.kind {
return Some(expr);
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/swap_ptr_to_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl LateLintPass<'_> for SwapPtrToRef {
fn is_ptr_to_ref(cx: &LateContext<'_>, e: &Expr<'_>, ctxt: SyntaxContext) -> (bool, Option<Span>) {
if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, borrowed_expr) = e.kind
&& let ExprKind::Unary(UnOp::Deref, derefed_expr) = borrowed_expr.kind
&& cx.typeck_results().expr_ty(derefed_expr).is_unsafe_ptr()
&& cx.typeck_results().expr_ty(derefed_expr).is_raw_ptr()
{
(
true,
Expand Down

0 comments on commit 15d08ef

Please sign in to comment.