Skip to content

Commit

Permalink
Avoid the path trimming ICE lint in error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Oct 29, 2023
1 parent bbcc169 commit 422686e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_const_eval/src/interpret/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use rustc_middle::mir::interpret::{InterpResult, PointerArithmetic, Scalar};
use rustc_middle::mir::CastKind;
use rustc_middle::ty::adjustment::PointerCoercion;
use rustc_middle::ty::layout::{IntegerExt, LayoutOf, TyAndLayout};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, FloatTy, Ty, TypeAndMut};
use rustc_target::abi::Integer;
use rustc_type_ir::TyKind::*;
Expand Down Expand Up @@ -147,8 +148,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
if src.layout.size != dest.layout.size {
let src_bytes = src.layout.size.bytes();
let dest_bytes = dest.layout.size.bytes();
let src_ty = format!("{}", src.layout.ty);
let dest_ty = format!("{}", dest.layout.ty);
let src_ty = with_no_trimmed_paths!(format!("{}", src.layout.ty));
let dest_ty = with_no_trimmed_paths!(format!("{}", dest.layout.ty));
throw_ub_custom!(
fluent::const_eval_invalid_transmute,
src_bytes = src_bytes,
Expand Down

0 comments on commit 422686e

Please sign in to comment.