diff options
| author | Ralf Jung <post@ralfj.de> | 2021-12-11 18:45:03 -0500 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2021-12-20 22:37:15 +0100 |
| commit | 56b7d5fc494639ad58111a73028dcee965df7246 (patch) | |
| tree | b78f409e06dec010a016415f12a55aa846a72926 | |
| parent | a97f41fd693d93d3afc91e8955ec308f9f157f73 (diff) | |
| download | rust-56b7d5fc494639ad58111a73028dcee965df7246.tar.gz rust-56b7d5fc494639ad58111a73028dcee965df7246.zip | |
better name for AdjustForForeignAbiError error variant in InterpError
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/eval_context.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/error.rs | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index eb562dc1e56..246807a112a 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -347,7 +347,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> FnAbiOfHelpers<'tcx> for InterpCx ) -> 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() + } } } } diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs index 3a9df35afaa..e9a857d0912 100644 --- a/compiler/rustc_middle/src/mir/interpret/error.rs +++ b/compiler/rustc_middle/src/mir/interpret/error.rs @@ -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 @@ impl fmt::Display for InvalidProgramInfo<'_> { 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", |
