about summary refs log tree commit diff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2021-03-14 17:06:18 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2021-03-14 17:06:18 +0300
commit14038c7df25d38b2f5b6790604374e1a33a01fe5 (patch)
tree44aa25a0d173e3a5eef23d6734e1e0b1d6f950b1
parent6ddd840f36a3951fb1ef9c7649fab161500c8268 (diff)
downloadrust-14038c7df25d38b2f5b6790604374e1a33a01fe5.tar.gz
rust-14038c7df25d38b2f5b6790604374e1a33a01fe5.zip
Remove duplicate asserts, replace eq assert with assert_eq
-rw-r--r--compiler/rustc_mir_build/src/build/expr/into.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_mir_build/src/build/expr/into.rs b/compiler/rustc_mir_build/src/build/expr/into.rs
index 47f75825fb6..a2adbdddc40 100644
--- a/compiler/rustc_mir_build/src/build/expr/into.rs
+++ b/compiler/rustc_mir_build/src/build/expr/into.rs
@@ -427,7 +427,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                 block.unit()
             }
             ExprKind::Index { .. } | ExprKind::Deref { .. } | ExprKind::Field { .. } => {
-                debug_assert!(Category::of(&expr.kind) == Some(Category::Place));
+                debug_assert_eq!(Category::of(&expr.kind), Some(Category::Place));
 
                 // Create a "fake" temporary variable so that we check that the
                 // value is Sized. Usually, this is caught in type checking, but
@@ -436,8 +436,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                     this.local_decls.push(LocalDecl::new(expr.ty, expr.span));
                 }
 
-                debug_assert!(Category::of(&expr.kind) == Some(Category::Place));
-
                 let place = unpack!(block = this.as_place(block, expr));
                 let rvalue = Rvalue::Use(this.consume_by_copy_or_move(place));
                 this.cfg.push_assign(block, source_info, destination, rvalue);