about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/validate.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-25 02:06:55 +0000
committerbors <bors@rust-lang.org>2024-09-25 02:06:55 +0000
commit1b5aa96d6016bafe50e071b45d4d2e3c90fd766f (patch)
tree4a859a69ea03e9d2cb552fe9bb29ae67059486a9 /compiler/rustc_mir_transform/src/validate.rs
parent3f99982c633dbca746140db60ed52ba7fa112803 (diff)
parent9737f923e2de6e66a692a4c260ed5313ff399386 (diff)
downloadrust-1b5aa96d6016bafe50e071b45d4d2e3c90fd766f.tar.gz
rust-1b5aa96d6016bafe50e071b45d4d2e3c90fd766f.zip
Auto merge of #130807 - tgross35:rollup-p304vzf, r=tgross35
Rollup of 7 pull requests

Successful merges:

 - #130234 (improve compile errors for invalid ptr-to-ptr casts with trait objects)
 - #130752 (Improve assembly test for CMSE ABIs)
 - #130764 (Separate collection of crate-local inherent impls from error tracking)
 - #130788 (Pin memchr to 2.5.0 in the library rather than rustc_ast)
 - #130789 (add InProgress ErrorKind gated behind io_error_inprogress feature)
 - #130793 (Mention `COMPILETEST_VERBOSE_CRASHES` on crash test failure)
 - #130798 (rustdoc: inherit parent's stability where applicable)

Failed merges:

 - #130735 (Simple validation for unsize coercion in MIR validation)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src/validate.rs')
-rw-r--r--compiler/rustc_mir_transform/src/validate.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs
index 914dddc1a56..eda0b8c75f3 100644
--- a/compiler/rustc_mir_transform/src/validate.rs
+++ b/compiler/rustc_mir_transform/src/validate.rs
@@ -1128,12 +1128,9 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
             Rvalue::Cast(kind, operand, target_type) => {
                 let op_ty = operand.ty(self.body, self.tcx);
                 match kind {
-                    CastKind::DynStar => {
-                        // FIXME(dyn-star): make sure nothing needs to be done here.
-                    }
                     // FIXME: Add Checks for these
                     CastKind::PointerWithExposedProvenance | CastKind::PointerExposeProvenance => {}
-                    CastKind::PointerCoercion(PointerCoercion::ReifyFnPointer) => {
+                    CastKind::PointerCoercion(PointerCoercion::ReifyFnPointer, _) => {
                         // FIXME: check signature compatibility.
                         check_kinds!(
                             op_ty,
@@ -1146,7 +1143,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             ty::FnPtr(..)
                         );
                     }
-                    CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer) => {
+                    CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer, _) => {
                         // FIXME: check safety and signature compatibility.
                         check_kinds!(
                             op_ty,
@@ -1159,7 +1156,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             ty::FnPtr(..)
                         );
                     }
-                    CastKind::PointerCoercion(PointerCoercion::ClosureFnPointer(..)) => {
+                    CastKind::PointerCoercion(PointerCoercion::ClosureFnPointer(..), _) => {
                         // FIXME: check safety, captures, and signature compatibility.
                         check_kinds!(
                             op_ty,
@@ -1172,7 +1169,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             ty::FnPtr(..)
                         );
                     }
-                    CastKind::PointerCoercion(PointerCoercion::MutToConstPointer) => {
+                    CastKind::PointerCoercion(PointerCoercion::MutToConstPointer, _) => {
                         // FIXME: check same pointee?
                         check_kinds!(
                             op_ty,
@@ -1188,7 +1185,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             self.fail(location, format!("After borrowck, MIR disallows {kind:?}"));
                         }
                     }
-                    CastKind::PointerCoercion(PointerCoercion::ArrayToPointer) => {
+                    CastKind::PointerCoercion(PointerCoercion::ArrayToPointer, _) => {
                         // FIXME: Check pointee types
                         check_kinds!(
                             op_ty,
@@ -1204,10 +1201,13 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             self.fail(location, format!("After borrowck, MIR disallows {kind:?}"));
                         }
                     }
-                    CastKind::PointerCoercion(PointerCoercion::Unsize) => {
+                    CastKind::PointerCoercion(PointerCoercion::Unsize, _) => {
                         // This is used for all `CoerceUnsized` types,
                         // not just pointers/references, so is hard to check.
                     }
+                    CastKind::PointerCoercion(PointerCoercion::DynStar, _) => {
+                        // FIXME(dyn-star): make sure nothing needs to be done here.
+                    }
                     CastKind::IntToInt | CastKind::IntToFloat => {
                         let input_valid = op_ty.is_integral() || op_ty.is_char() || op_ty.is_bool();
                         let target_valid = target_type.is_numeric() || target_type.is_char();