about summary refs log tree commit diff
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
commitbaacbfda45c4f7b6c679ac7d03d374b0a1d58391 (patch)
treeea2e096eac44657a272568adf7eb09ea2e84a1ba
parent2a18d124aaea78d2fad8be0135fa8182d40e32fb (diff)
parent0600de4d127ce56984f90674c5dfff9b91bb6ba3 (diff)
downloadrust-baacbfda45c4f7b6c679ac7d03d374b0a1d58391.tar.gz
rust-baacbfda45c4f7b6c679ac7d03d374b0a1d58391.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
-rw-r--r--clippy_utils/src/qualify_min_const_fn.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs
index b1c82ac76e8..58abef38ea8 100644
--- a/clippy_utils/src/qualify_min_const_fn.rs
+++ b/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(