Skip to content

Commit

Permalink
Rollup merge of rust-lang#104357 - RalfJung:is-sized, r=cjgillot
Browse files Browse the repository at this point in the history
add is_sized method on Abi and Layout, and use it

This avoids the double negation of `!is_unsized()` that we have quite a lot.
  • Loading branch information
matthiaskrgr authored Nov 13, 2022
2 parents e5b6ca1 + 35628f9 commit a8e8f18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stacked_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
// pointers we need to retag, so we can stop recursion early.
// This optimization is crucial for ZSTs, because they can contain way more fields
// than we can ever visit.
if !place.layout.is_unsized() && place.layout.size < self.ecx.pointer_size() {
if place.layout.is_sized() && place.layout.size < self.ecx.pointer_size() {
return Ok(());
}

Expand Down

0 comments on commit a8e8f18

Please sign in to comment.