// Export these here so that Clippy can use them.
pub use mc::{Place, PlaceBase, Projection};
-use rustc::hir::def::Res;
-use rustc::hir::def_id::DefId;
-use rustc::hir::ptr::P;
-use rustc::hir::{self, PatKind};
use rustc::infer::InferCtxt;
use rustc::ty::{self, adjustment, TyCtxt};
+use rustc_hir as hir;
+use rustc_hir::def::Res;
+use rustc_hir::def_id::DefId;
+use rustc_hir::PatKind;
use crate::mem_categorization as mc;
-use syntax_pos::Span;
+use rustc_span::Span;
///////////////////////////////////////////////////////////////////////////
// The Delegate trait
hir::ExprKind::Type(ref subexpr, _) => self.walk_expr(subexpr),
- hir::ExprKind::Unary(hir::UnDeref, ref base) => {
+ hir::ExprKind::Unary(hir::UnOp::UnDeref, ref base) => {
// *base
self.select_from_expr(base);
}
self.consume_exprs(exprs);
}
- hir::ExprKind::Match(ref discr, ref arms, _) => {
+ hir::ExprKind::Match(ref discr, arms, _) => {
let discr_place = return_if_err!(self.mc.cat_expr(&discr));
self.borrow_expr(&discr, ty::ImmBorrow);
}
hir::ExprKind::InlineAsm(ref ia) => {
- for (o, output) in ia.inner.outputs.iter().zip(&ia.outputs_exprs) {
+ for (o, output) in ia.inner.outputs.iter().zip(ia.outputs_exprs) {
if o.is_indirect {
self.consume_expr(output);
} else {
fn walk_block(&mut self, blk: &hir::Block<'_>) {
debug!("walk_block(blk.hir_id={})", blk.hir_id);
- for stmt in &blk.stmts {
+ for stmt in blk.stmts {
self.walk_stmt(stmt);
}
}
}
- fn walk_struct_expr(&mut self, fields: &[hir::Field<'_>], opt_with: &Option<P<hir::Expr<'_>>>) {
+ fn walk_struct_expr(
+ &mut self,
+ fields: &[hir::Field<'_>],
+ opt_with: &Option<&'hir hir::Expr<'_>>,
+ ) {
// Consume the expressions supplying values for each field.
for field in fields {
self.consume_expr(&field.expr);