Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ralf Jung <post@ralfj.de>
  • Loading branch information
saethlin and RalfJung committed Jun 5, 2024
1 parent fe7f3a3 commit 7450aeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_const_eval/src/interpret/terminator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
// Check if this is `Option` wrapping some type or if this is `Result` wrapping a 1-ZST and
// another type.
let ty::Adt(def, args) = layout.ty.kind() else {
// Not an `Option` or Result.
// Not an ADT, so definitely no NPO.
return Ok(layout);
};
let inner = if self.tcx.is_diagnostic_item(sym::Option, def.did()) {
Expand All @@ -312,10 +312,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
} else if rhs.is_1zst() {
lhs
} else {
return Ok(layout);
return Ok(layout); // no NPO
}
} else {
return Ok(layout);
return Ok(layout); // no NPO
};

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

0 comments on commit 7450aeb

Please sign in to comment.