Skip to content

Commit 56b7d5f

Browse files
committed
better name for AdjustForForeignAbiError error variant in InterpError
1 parent a97f41f commit 56b7d5f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Diff for: compiler/rustc_const_eval/src/interpret/eval_context.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> FnAbiOfHelpers<'tcx> for InterpCx
347347
) -> InterpErrorInfo<'tcx> {
348348
match err {
349349
FnAbiError::Layout(err) => err_inval!(Layout(err)).into(),
350-
FnAbiError::AdjustForForeignAbi(err) => err_inval!(FnAbi(err)).into(),
350+
FnAbiError::AdjustForForeignAbi(err) => {
351+
err_inval!(FnAbiAdjustForForeignAbi(err)).into()
352+
}
351353
}
352354
}
353355
}

Diff for: compiler/rustc_middle/src/mir/interpret/error.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ pub enum InvalidProgramInfo<'tcx> {
141141
AlreadyReported(ErrorReported),
142142
/// An error occurred during layout computation.
143143
Layout(layout::LayoutError<'tcx>),
144-
/// An error occurred during FnAbi computation.
145-
/// (Not using `FnAbiError` as that contains a nested `LayoutError`.)
146-
FnAbi(call::AdjustForForeignAbiError),
144+
/// An error occurred during FnAbi computation: the passed --target lacks FFI support
145+
/// (which unfortunately typeck does not reject).
146+
/// Not using `FnAbiError` as that contains a nested `LayoutError`.
147+
FnAbiAdjustForForeignAbi(call::AdjustForForeignAbiError),
147148
/// An invalid transmute happened.
148149
TransmuteSizeDiff(Ty<'tcx>, Ty<'tcx>),
149150
/// SizeOf of unsized type was requested.
@@ -160,7 +161,7 @@ impl fmt::Display for InvalidProgramInfo<'_> {
160161
write!(f, "encountered constants with type errors, stopping evaluation")
161162
}
162163
Layout(ref err) => write!(f, "{}", err),
163-
FnAbi(ref err) => write!(f, "{}", err),
164+
FnAbiAdjustForForeignAbi(ref err) => write!(f, "{}", err),
164165
TransmuteSizeDiff(from_ty, to_ty) => write!(
165166
f,
166167
"transmuting `{}` to `{}` is not possible, because these types do not have the same size",

0 commit comments

Comments
 (0)