Skip to content

Commit 7450aeb

Browse files
saethlinRalfJung
andauthored
Apply suggestions from code review
Co-authored-by: Ralf Jung <[email protected]>
1 parent fe7f3a3 commit 7450aeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_const_eval/src/interpret/terminator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
297297
// Check if this is `Option` wrapping some type or if this is `Result` wrapping a 1-ZST and
298298
// another type.
299299
let ty::Adt(def, args) = layout.ty.kind() else {
300-
// Not an `Option` or Result.
300+
// Not an ADT, so definitely no NPO.
301301
return Ok(layout);
302302
};
303303
let inner = if self.tcx.is_diagnostic_item(sym::Option, def.did()) {
@@ -312,10 +312,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
312312
} else if rhs.is_1zst() {
313313
lhs
314314
} else {
315-
return Ok(layout);
315+
return Ok(layout); // no NPO
316316
}
317317
} else {
318-
return Ok(layout);
318+
return Ok(layout); // no NPO
319319
};
320320

321321
// Check if the inner type is one of the NPO-guaranteed ones.

0 commit comments

Comments
 (0)