about summary refs log tree commit diff
path: root/src/tools/clippy/clippy_utils
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-06-03 11:18:24 +0200
committerGitHub <noreply@github.com>2022-06-03 11:18:24 +0200
commitf116dd76ed93b8d5bd920ec95f3a0d52ce6a525c (patch)
treef42079d9f47f6de76d30c10eccf33d8a9a9c0eb6 /src/tools/clippy/clippy_utils
parent025cf96615f44be6a75f82df50fa0f9e0e569b96 (diff)
parentd5a590f53744add6e37eee19f4591f2be6d990f8 (diff)
downloadrust-f116dd76ed93b8d5bd920ec95f3a0d52ce6a525c.tar.gz
rust-f116dd76ed93b8d5bd920ec95f3a0d52ce6a525c.zip
Rollup merge of #97653 - RalfJung:int-to-ptr, r=oli-obk
add cast kind of from_exposed_addr (int-to-ptr casts)

This is basically the dual to https://github.com/rust-lang/rust/pull/97582, for int2ptr casts.

Cc `@tmiasko` https://github.com/rust-lang/rust/issues/97649
Diffstat (limited to 'src/tools/clippy/clippy_utils')
-rw-r--r--src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
index b1c82ac76e8..58abef38ea8 100644
--- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
+++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
@@ -131,7 +131,12 @@ fn check_rvalue<'tcx>(
         Rvalue::Cast(CastKind::Misc, operand, _) => {
             check_operand(tcx, operand, span, body)
         },
-        Rvalue::Cast(CastKind::Pointer(PointerCast::MutToConstPointer | PointerCast::ArrayToPointer), operand, _) => {
+        Rvalue::Cast(
+            CastKind::PointerFromExposedAddress
+            | CastKind::Pointer(PointerCast::MutToConstPointer | PointerCast::ArrayToPointer),
+            operand,
+            _
+        ) => {
             check_operand(tcx, operand, span, body)
         },
         Rvalue::Cast(