]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
add cast kind of from_exposed_addr (int-to-ptr casts)
[rust.git] / src / tools / clippy / clippy_utils / src / qualify_min_const_fn.rs
index 283b20fc24d82c62317ccc19dc8e69f26a2cb94c..58abef38ea8be9e1cc7505536de596ac62e8d76f 100644 (file)
@@ -125,13 +125,18 @@ fn check_rvalue<'tcx>(
         Rvalue::Len(place) | Rvalue::Discriminant(place) | Rvalue::Ref(_, _, place) | Rvalue::AddressOf(_, place) => {
             check_place(tcx, *place, span, body)
         },
-        Rvalue::Cast(CastKind::PointerAddress, _, _) => {
+        Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => {
             Err((span, "casting pointers to ints is unstable in const fn".into()))
         },
         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(