]> git.lizzy.rs Git - rust.git/commitdiff
better name for AdjustForForeignAbiError error variant in InterpError
authorRalf Jung <post@ralfj.de>
Sat, 11 Dec 2021 23:45:03 +0000 (18:45 -0500)
committerRalf Jung <post@ralfj.de>
Mon, 20 Dec 2021 21:37:15 +0000 (22:37 +0100)
compiler/rustc_const_eval/src/interpret/eval_context.rs
compiler/rustc_middle/src/mir/interpret/error.rs

index eb562dc1e56346f7e503c481940052c9c00e50d9..246807a112a40b733c4290e44aed653c72898f1a 100644 (file)
@@ -347,7 +347,9 @@ fn handle_fn_abi_err(
     ) -> InterpErrorInfo<'tcx> {
         match err {
             FnAbiError::Layout(err) => err_inval!(Layout(err)).into(),
-            FnAbiError::AdjustForForeignAbi(err) => err_inval!(FnAbi(err)).into(),
+            FnAbiError::AdjustForForeignAbi(err) => {
+                err_inval!(FnAbiAdjustForForeignAbi(err)).into()
+            }
         }
     }
 }
index 3a9df35afaaca309f702d5d95abaa312fb78ca12..e9a857d09124f4cad822cd3213adb0625d761891 100644 (file)
@@ -141,9 +141,10 @@ pub enum InvalidProgramInfo<'tcx> {
     AlreadyReported(ErrorReported),
     /// An error occurred during layout computation.
     Layout(layout::LayoutError<'tcx>),
-    /// An error occurred during FnAbi computation.
-    /// (Not using `FnAbiError` as that contains a nested `LayoutError`.)
-    FnAbi(call::AdjustForForeignAbiError),
+    /// An error occurred during FnAbi computation: the passed --target lacks FFI support
+    /// (which unfortunately typeck does not reject).
+    /// Not using `FnAbiError` as that contains a nested `LayoutError`.
+    FnAbiAdjustForForeignAbi(call::AdjustForForeignAbiError),
     /// An invalid transmute happened.
     TransmuteSizeDiff(Ty<'tcx>, Ty<'tcx>),
     /// SizeOf of unsized type was requested.
@@ -160,7 +161,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                 write!(f, "encountered constants with type errors, stopping evaluation")
             }
             Layout(ref err) => write!(f, "{}", err),
-            FnAbi(ref err) => write!(f, "{}", err),
+            FnAbiAdjustForForeignAbi(ref err) => write!(f, "{}", err),
             TransmuteSizeDiff(from_ty, to_ty) => write!(
                 f,
                 "transmuting `{}` to `{}` is not possible, because these types do not have the same size",