From 5abaeb3d6712b54f3309df968ebee39e544d0fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Mon, 2 Mar 2020 18:53:56 +0100 Subject: [PATCH] Simplify conditions like x + 1 <= y to x < y --- src/liballoc/collections/btree/node.rs | 2 +- src/librustc/mir/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs index c1bd68a020a..362755f8b7f 100644 --- a/src/liballoc/collections/btree/node.rs +++ b/src/liballoc/collections/btree/node.rs @@ -1191,7 +1191,7 @@ impl<'a, K, V> Handle, K, V, marker::Internal>, marker:: let right_len = right_node.len(); // necessary for correctness, but in a private module - assert!(left_len + right_len + 1 <= CAPACITY); + assert!(left_len + right_len < CAPACITY); unsafe { ptr::write( diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 668240ab42b..36818020569 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -189,7 +189,7 @@ impl<'tcx> Body<'tcx> { ) -> Self { // We need `arg_count` locals, and one for the return place. assert!( - local_decls.len() >= arg_count + 1, + local_decls.len() > arg_count, "expected at least {} locals, got {}", arg_count + 1, local_decls.len()