Skip to content

Commit e5d50e3

Browse files
committed
comments
1 parent e822235 commit e5d50e3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustc_codegen_ssa/mir/operand.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
475475
},
476476
}
477477
// Allow RalfJ to sleep soundly knowing that even refactorings that remove
478-
// the above error (or silence it under some conditions) will not cause UB
478+
// the above error (or silence it under some conditions) will not cause UB.
479479
bx.abort();
480-
// We've errored, so we don't have to produce working code.
480+
// We still have to return an operand but it doesn't matter,
481+
// this code is unreachable.
481482
let ty = self.monomorphize(&constant.literal.ty);
482483
let layout = bx.cx().layout_of(ty);
483484
bx.load_operand(PlaceRef::new_sized(

src/librustc_codegen_ssa/mir/place.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
493493
// With floats that won't always be true,
494494
// so we generate a (safe) abort.
495495
bx.abort();
496+
// We still have to return a place but it doesn't matter,
497+
// this code is unreachable.
496498
let llval = bx.cx().const_undef(
497499
bx.cx().type_ptr_to(bx.cx().backend_type(layout))
498500
);

0 commit comments

Comments
 (0)