Skip to content

Commit 14038c7

Browse files
committed
Remove duplicate asserts, replace eq assert with assert_eq
1 parent 6ddd840 commit 14038c7

File tree

1 file changed

+1
-3
lines changed
  • compiler/rustc_mir_build/src/build/expr

1 file changed

+1
-3
lines changed

compiler/rustc_mir_build/src/build/expr/into.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
427427
block.unit()
428428
}
429429
ExprKind::Index { .. } | ExprKind::Deref { .. } | ExprKind::Field { .. } => {
430-
debug_assert!(Category::of(&expr.kind) == Some(Category::Place));
430+
debug_assert_eq!(Category::of(&expr.kind), Some(Category::Place));
431431

432432
// Create a "fake" temporary variable so that we check that the
433433
// value is Sized. Usually, this is caught in type checking, but
@@ -436,8 +436,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
436436
this.local_decls.push(LocalDecl::new(expr.ty, expr.span));
437437
}
438438

439-
debug_assert!(Category::of(&expr.kind) == Some(Category::Place));
440-
441439
let place = unpack!(block = this.as_place(block, expr));
442440
let rvalue = Rvalue::Use(this.consume_by_copy_or_move(place));
443441
this.cfg.push_assign(block, source_info, destination, rvalue);

0 commit comments

Comments
 (0)