use rustc::hir::map::Map;
use rustc::ty::{self, Ty, TyCtxt};
+use rustc_ast::ast::Mutability;
use rustc_errors::{error_code, struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def::*;
use rustc_session::parse::feature_err;
use rustc_session::Session;
use rustc_span::{sym, Span};
-use syntax::ast::Mutability;
use std::slice;
impl<'tcx> Visitor<'tcx> for MatchVisitor<'_, 'tcx> {
type Map = Map<'tcx>;
- fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
+ fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}
}
fn check_in_cx(&self, hir_id: HirId, f: impl FnOnce(MatchCheckCtxt<'_, 'tcx>)) {
- let module = self.tcx.hir().get_module_parent(hir_id);
+ let module = self.tcx.parent_module(hir_id);
MatchCheckCtxt::create_and_enter(self.tcx, self.param_env, module, |cx| f(cx));
}
impl<'v> Visitor<'v> for AtBindingPatternVisitor<'_, '_, '_> {
type Map = Map<'v>;
- fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
+ fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
NestedVisitorMap::None
}