Remove duplicate asserts, replace eq assert with assert_eq
This commit is contained in:
parent
6ddd840f36
commit
14038c7df2
1 changed files with 1 additions and 3 deletions
|
@ -427,7 +427,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
block.unit()
|
block.unit()
|
||||||
}
|
}
|
||||||
ExprKind::Index { .. } | ExprKind::Deref { .. } | ExprKind::Field { .. } => {
|
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
|
// Create a "fake" temporary variable so that we check that the
|
||||||
// value is Sized. Usually, this is caught in type checking, but
|
// 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));
|
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 place = unpack!(block = this.as_place(block, expr));
|
||||||
let rvalue = Rvalue::Use(this.consume_by_copy_or_move(place));
|
let rvalue = Rvalue::Use(this.consume_by_copy_or_move(place));
|
||||||
this.cfg.push_assign(block, source_info, destination, rvalue);
|
this.cfg.push_assign(block, source_info, destination, rvalue);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue