Skip to content

Commit

Permalink
Unrolled build for rust-lang#117373
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#117373 - saethlin:avoid-ice-lint, r=compiler-errors

Avoid the path trimming ICE lint in error reporting

Types or really anything in MIR should never be formatted without path trimming disabled, because its formatting often tries to construct trimmed paths. In this case, the lint turns a nice error report into an irrelevant ICE.
  • Loading branch information
rust-timer authored Nov 2, 2023
2 parents 75b064d + 88f0688 commit 645a4df
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions compiler/rustc_const_eval/src/interpret/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,12 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
assert!(dest.layout.is_sized());
assert_eq!(cast_ty, dest.layout.ty); // we otherwise ignore `cast_ty` enirely...
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);
throw_ub_custom!(
fluent::const_eval_invalid_transmute,
src_bytes = src_bytes,
dest_bytes = dest_bytes,
src = src_ty,
dest = dest_ty,
src_bytes = src.layout.size.bytes(),
dest_bytes = dest.layout.size.bytes(),
src = src.layout.ty,
dest = dest.layout.ty,
);
}

Expand Down

0 comments on commit 645a4df

Please sign in to comment.