Skip to content

Commit 422686e

Browse files
committed
Avoid the path trimming ICE lint in error reporting
1 parent bbcc169 commit 422686e

File tree

1 file changed

+3
-2
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+3
-2
lines changed

compiler/rustc_const_eval/src/interpret/cast.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use rustc_middle::mir::interpret::{InterpResult, PointerArithmetic, Scalar};
66
use rustc_middle::mir::CastKind;
77
use rustc_middle::ty::adjustment::PointerCoercion;
88
use rustc_middle::ty::layout::{IntegerExt, LayoutOf, TyAndLayout};
9+
use rustc_middle::ty::print::with_no_trimmed_paths;
910
use rustc_middle::ty::{self, FloatTy, Ty, TypeAndMut};
1011
use rustc_target::abi::Integer;
1112
use rustc_type_ir::TyKind::*;
@@ -147,8 +148,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
147148
if src.layout.size != dest.layout.size {
148149
let src_bytes = src.layout.size.bytes();
149150
let dest_bytes = dest.layout.size.bytes();
150-
let src_ty = format!("{}", src.layout.ty);
151-
let dest_ty = format!("{}", dest.layout.ty);
151+
let src_ty = with_no_trimmed_paths!(format!("{}", src.layout.ty));
152+
let dest_ty = with_no_trimmed_paths!(format!("{}", dest.layout.ty));
152153
throw_ub_custom!(
153154
fluent::const_eval_invalid_transmute,
154155
src_bytes = src_bytes,

0 commit comments

Comments
 (0)