Skip to content

Commit 8539bc3

Browse files
Rollup merge of #126328 - RalfJung:is_none_or, r=workingjubilee
Add Option::is_none_or ACP: rust-lang/libs-team#212
2 parents 7981363 + ae14e96 commit 8539bc3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#![feature(lint_reasons)]
1414
#![feature(trait_upcasting)]
1515
#![feature(strict_overflow_ops)]
16+
#![feature(is_none_or)]
1617
// Configure clippy and other lints
1718
#![allow(
1819
clippy::collapsible_else_if,

src/shims/foreign_items.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,12 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
396396
// If the newly promised alignment is bigger than the native alignment of this
397397
// allocation, and bigger than the previously promised alignment, then set it.
398398
if align > alloc_align
399-
&& !this
399+
&& this
400400
.machine
401401
.symbolic_alignment
402402
.get_mut()
403403
.get(&alloc_id)
404-
.is_some_and(|&(_, old_align)| align <= old_align)
404+
.is_none_or(|&(_, old_align)| align > old_align)
405405
{
406406
this.machine.symbolic_alignment.get_mut().insert(alloc_id, (offset, align));
407407
}

0 commit comments

Comments
 (0)