|
1 | 1 | use rustc_hir as hir;
|
2 | 2 | use rustc_hir::def_id::DefId;
|
3 |
| -use rustc_middle::mir::*; |
| 3 | +use rustc_middle::mir::{ |
| 4 | + Body, CastKind, NullOp, Operand, Place, ProjectionElem, Rvalue, Statement, StatementKind, Terminator, |
| 5 | + TerminatorKind, |
| 6 | +}; |
4 | 7 | use rustc_middle::ty::subst::GenericArgKind;
|
5 | 8 | use rustc_middle::ty::{self, adjustment::PointerCast, Ty, TyCtxt};
|
6 | 9 | use rustc_span::symbol::sym;
|
@@ -208,8 +211,7 @@ fn check_statement(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId, statemen
|
208 | 211 | check_rvalue(tcx, body, def_id, rval, span)
|
209 | 212 | },
|
210 | 213 |
|
211 |
| - StatementKind::FakeRead(_, place) => check_place(tcx, **place, span, body), |
212 |
| - |
| 214 | + StatementKind::FakeRead(_, place) | |
213 | 215 | // just an assignment
|
214 | 216 | StatementKind::SetDiscriminant { place, .. } => check_place(tcx, **place, span, body),
|
215 | 217 |
|
@@ -237,7 +239,7 @@ fn check_operand(tcx: TyCtxt<'tcx>, operand: &Operand<'tcx>, span: Span, body: &
|
237 | 239 |
|
238 | 240 | fn check_place(tcx: TyCtxt<'tcx>, place: Place<'tcx>, span: Span, body: &Body<'tcx>) -> McfResult {
|
239 | 241 | let mut cursor = place.projection.as_ref();
|
240 |
| - while let &[ref proj_base @ .., elem] = cursor { |
| 242 | + while let [ref proj_base @ .., elem] = *cursor { |
241 | 243 | cursor = proj_base;
|
242 | 244 | match elem {
|
243 | 245 | ProjectionElem::Field(..) => {
|
|
0 commit comments