Skip to content

Commit bddba23

Browse files
committed
s/tcx.hir/tcx.map
1 parent b1be0d6 commit bddba23

33 files changed

+77
-77
lines changed

clippy_lints/src/assign_ops.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
143143
return; // useless if the trait doesn't exist
144144
};
145145
// check that we are not inside an `impl AssignOp` of this exact operation
146-
let parent_fn = cx.tcx.map.get_parent(e.id);
147-
let parent_impl = cx.tcx.map.get_parent(parent_fn);
146+
let parent_fn = cx.tcx.hir.get_parent(e.id);
147+
let parent_impl = cx.tcx.hir.get_parent(parent_fn);
148148
// the crate node is the only one that is not in the map
149149
if_let_chain!{[
150150
parent_impl != ast::CRATE_NODE_ID,
151-
let hir::map::Node::NodeItem(item) = cx.tcx.map.get(parent_impl),
151+
let hir::map::Node::NodeItem(item) = cx.tcx.hir.get(parent_impl),
152152
let hir::Item_::ItemImpl(_, _, _, Some(ref trait_ref), _, _) = item.node,
153153
trait_ref.path.def.def_id() == trait_id
154154
], { return; }}

clippy_lints/src/attrs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
158158

159159
fn is_relevant_item(tcx: ty::TyCtxt, item: &Item) -> bool {
160160
if let ItemFn(_, _, _, _, _, eid) = item.node {
161-
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.map.body(eid).value)
161+
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value)
162162
} else {
163163
false
164164
}
165165
}
166166

167167
fn is_relevant_impl(tcx: ty::TyCtxt, item: &ImplItem) -> bool {
168168
match item.node {
169-
ImplItemKind::Method(_, eid) => is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.map.body(eid).value),
169+
ImplItemKind::Method(_, eid) => is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value),
170170
_ => false,
171171
}
172172
}
@@ -175,7 +175,7 @@ fn is_relevant_trait(tcx: ty::TyCtxt, item: &TraitItem) -> bool {
175175
match item.node {
176176
TraitItemKind::Method(_, TraitMethod::Required(_)) => true,
177177
TraitItemKind::Method(_, TraitMethod::Provided(eid)) => {
178-
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.map.body(eid).value)
178+
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value)
179179
},
180180
_ => false,
181181
}

clippy_lints/src/block_in_if_condition.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct ExVisitor<'a, 'tcx: 'a> {
5757
impl<'a, 'tcx: 'a> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
5858
fn visit_expr(&mut self, expr: &'tcx Expr) {
5959
if let ExprClosure(_, _, eid, _) = expr.node {
60-
let body = self.cx.tcx.map.body(eid);
60+
let body = self.cx.tcx.hir.body(eid);
6161
let ex = &body.value;
6262
if matches!(ex.node, ExprBlock(_)) {
6363
self.found_block = Some(ex);
@@ -67,7 +67,7 @@ impl<'a, 'tcx: 'a> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
6767
walk_expr(self, expr);
6868
}
6969
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
70-
NestedVisitorMap::All(&self.cx.tcx.map)
70+
NestedVisitorMap::All(&self.cx.tcx.hir)
7171
}
7272
}
7373

clippy_lints/src/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
263263
ExprRepeat(ref value, number_id) => {
264264
if let Some(lcx) = self.lcx {
265265
self.binop_apply(value,
266-
&lcx.tcx.map.body(number_id).value,
266+
&lcx.tcx.hir.body(number_id).value,
267267
|v, n| Some(Constant::Repeat(Box::new(v), n.as_u64() as usize)))
268268
} else {
269269
None

clippy_lints/src/cyclomatic_complexity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CyclomaticComplexity {
9999
span: Span,
100100
node_id: NodeId
101101
) {
102-
let def_id = cx.tcx.map.local_def_id(node_id);
102+
let def_id = cx.tcx.hir.local_def_id(node_id);
103103
if !cx.tcx.has_attr(def_id, "test") {
104104
self.check(cx, &body.value, span);
105105
}

clippy_lints/src/derive.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl LintPass for Derive {
7373
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Derive {
7474
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
7575
if let ItemImpl(_, _, _, Some(ref trait_ref), _, _) = item.node {
76-
let ty = cx.tcx.item_type(cx.tcx.map.local_def_id(item.id));
76+
let ty = cx.tcx.item_type(cx.tcx.hir.local_def_id(item.id));
7777
let is_automatically_derived = is_automatically_derived(&*item.attrs);
7878

7979
check_hash_peq(cx, item.span, trait_ref, ty, is_automatically_derived);
@@ -122,9 +122,9 @@ fn check_hash_peq<'a, 'tcx>(
122122
cx, DERIVE_HASH_XOR_EQ, span,
123123
mess,
124124
|db| {
125-
if let Some(node_id) = cx.tcx.map.as_local_node_id(impl_id) {
125+
if let Some(node_id) = cx.tcx.hir.as_local_node_id(impl_id) {
126126
db.span_note(
127-
cx.tcx.map.span(node_id),
127+
cx.tcx.hir.span(node_id),
128128
"`PartialEq` implemented here"
129129
);
130130
}

clippy_lints/src/entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,6 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for InsertVisitor<'a, 'tcx, 'b> {
148148
}
149149
}
150150
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
151-
NestedVisitorMap::All(&self.cx.tcx.map)
151+
NestedVisitorMap::All(&self.cx.tcx.hir)
152152
}
153153
}

clippy_lints/src/enum_clike.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
4545
if let Some(body_id) = variant.disr_expr {
4646
use rustc_const_eval::*;
4747
let constcx = ConstContext::new(cx.tcx, body_id);
48-
let bad = match constcx.eval(&cx.tcx.map.body(body_id).value, EvalHint::ExprTypeChecked) {
48+
let bad = match constcx.eval(&cx.tcx.hir.body(body_id).value, EvalHint::ExprTypeChecked) {
4949
Ok(ConstVal::Integral(Usize(Us64(i)))) => i as u32 as u64 != i,
5050
Ok(ConstVal::Integral(Isize(Is64(i)))) => i as i32 as i64 != i,
5151
_ => false,

clippy_lints/src/escape.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
8989
for node in v.set {
9090
span_lint(cx,
9191
BOXED_LOCAL,
92-
cx.tcx.map.span(node),
92+
cx.tcx.hir.span(node),
9393
"local variable doesn't need to be boxed here");
9494
}
9595
}
@@ -108,7 +108,7 @@ impl<'a, 'tcx: 'a> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
108108
}
109109
fn matched_pat(&mut self, _: &Pat, _: cmt<'tcx>, _: MatchMode) {}
110110
fn consume_pat(&mut self, consume_pat: &Pat, cmt: cmt<'tcx>, _: ConsumeMode) {
111-
let map = &self.tcx.map;
111+
let map = &self.tcx.hir;
112112
if map.is_argument(consume_pat.id) {
113113
// Skip closure arguments
114114
if let Some(NodeExpr(..)) = map.find(map.get_parent_node(consume_pat.id)) {
@@ -180,7 +180,7 @@ impl<'a, 'tcx: 'a> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
180180
self.tables
181181
.adjustments
182182
.get(&self.tcx
183-
.map
183+
.hir
184184
.get_parent_node(borrow_id))
185185
.map(|a| &a.kind) {
186186
if autoderefs <= 1 {

clippy_lints/src/eta_reduction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EtaPass {
4949

5050
fn check_closure(cx: &LateContext, expr: &Expr) {
5151
if let ExprClosure(_, ref decl, eid, _) = expr.node {
52-
let body = cx.tcx.map.body(eid);
52+
let body = cx.tcx.hir.body(eid);
5353
let ex = &body.value;
5454
if let ExprCall(ref caller, ref args) = ex.node {
5555
if args.len() != decl.inputs.len() {

clippy_lints/src/eval_order_dependence.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> {
156156
// don't continue over blocks, LateLintPass already does that
157157
}
158158
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
159-
NestedVisitorMap::All(&self.cx.tcx.map)
159+
NestedVisitorMap::All(&self.cx.tcx.hir)
160160
}
161161
}
162162

@@ -176,7 +176,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> {
176176
///
177177
/// When such a read is found, the lint is triggered.
178178
fn check_for_unsequenced_reads(vis: &mut ReadVisitor) {
179-
let map = &vis.cx.tcx.map;
179+
let map = &vis.cx.tcx.hir;
180180
let mut cur_id = vis.write_expr.id;
181181
loop {
182182
let parent_id = map.get_parent_node(cur_id);
@@ -342,7 +342,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ReadVisitor<'a, 'tcx> {
342342
walk_expr(self, expr);
343343
}
344344
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
345-
NestedVisitorMap::All(&self.cx.tcx.map)
345+
NestedVisitorMap::All(&self.cx.tcx.hir)
346346
}
347347
}
348348

clippy_lints/src/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ pub fn get_argument_fmtstr_parts<'a, 'b>(cx: &LateContext<'a, 'b>, expr: &'a Exp
7878
block.stmts.len() == 1,
7979
let StmtDecl(ref decl, _) = block.stmts[0].node,
8080
let DeclItem(ref decl) = decl.node,
81-
let Some(NodeItem(decl)) = cx.tcx.map.find(decl.id),
81+
let Some(NodeItem(decl)) = cx.tcx.hir.find(decl.id),
8282
&*decl.name.as_str() == "__STATIC_FMTSTR",
8383
let ItemStatic(_, _, ref expr) = decl.node,
84-
let ExprAddrOf(_, ref expr) = cx.tcx.map.body(*expr).value.node, // &["…", "…", …]
84+
let ExprAddrOf(_, ref expr) = cx.tcx.hir.body(*expr).value.node, // &["…", "…", …]
8585
let ExprArray(ref exprs) = expr.node,
8686
], {
8787
let mut result = Vec::new();

clippy_lints/src/functions.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
8080
) {
8181
use rustc::hir::map::Node::*;
8282

83-
let is_impl = if let Some(NodeItem(item)) = cx.tcx.map.find(cx.tcx.map.get_parent_node(nodeid)) {
83+
let is_impl = if let Some(NodeItem(item)) = cx.tcx.hir.find(cx.tcx.hir.get_parent_node(nodeid)) {
8484
matches!(item.node, hir::ItemImpl(_, _, _, Some(_), _, _) | hir::ItemDefaultImpl(..))
8585
} else {
8686
false
@@ -113,7 +113,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
113113
}
114114

115115
if let hir::TraitMethod::Provided(eid) = *eid {
116-
let body = cx.tcx.map.body(eid);
116+
let body = cx.tcx.hir.body(eid);
117117
self.check_raw_ptr(cx, sig.unsafety, &sig.decl, body, item.id);
118118
}
119119
}
@@ -200,7 +200,7 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> {
200200
hir::intravisit::walk_expr(self, expr);
201201
}
202202
fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'this, 'tcx> {
203-
intravisit::NestedVisitorMap::All(&self.cx.tcx.map)
203+
intravisit::NestedVisitorMap::All(&self.cx.tcx.hir)
204204
}
205205
}
206206

clippy_lints/src/large_enum_variant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl LintPass for LargeEnumVariant {
4646

4747
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeEnumVariant {
4848
fn check_item(&mut self, cx: &LateContext, item: &Item) {
49-
let did = cx.tcx.map.local_def_id(item.id);
49+
let did = cx.tcx.hir.local_def_id(item.id);
5050
if let ItemEnum(ref def, _) = item.node {
5151
let ty = cx.tcx.item_type(did);
5252
let adt = ty.ty_adt_def().expect("already checked whether this is an enum");

clippy_lints/src/len_zero.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn check_trait_items(cx: &LateContext, item: &Item, trait_items: &[TraitItemRef]
9393
if let AssociatedItemKind::Method { has_self } = item.kind {
9494
has_self &&
9595
{
96-
let did = cx.tcx.map.local_def_id(item.id.node_id);
96+
let did = cx.tcx.hir.local_def_id(item.id.node_id);
9797
let impl_ty = cx.tcx.item_type(did);
9898
impl_ty.fn_args().skip_binder().len() == 1
9999
}
@@ -120,7 +120,7 @@ fn check_impl_items(cx: &LateContext, item: &Item, impl_items: &[ImplItemRef]) {
120120
if let AssociatedItemKind::Method { has_self } = item.kind {
121121
has_self &&
122122
{
123-
let did = cx.tcx.map.local_def_id(item.id.node_id);
123+
let did = cx.tcx.hir.local_def_id(item.id.node_id);
124124
let impl_ty = cx.tcx.item_type(did);
125125
impl_ty.fn_args().skip_binder().len() == 1
126126
}
@@ -141,7 +141,7 @@ fn check_impl_items(cx: &LateContext, item: &Item, impl_items: &[ImplItemRef]) {
141141

142142
if let Some(i) = impl_items.iter().find(|i| is_named_self(cx, i, "len")) {
143143
if cx.access_levels.is_exported(i.id.node_id) {
144-
let def_id = cx.tcx.map.local_def_id(item.id);
144+
let def_id = cx.tcx.hir.local_def_id(item.id);
145145
let ty = cx.tcx.item_type(def_id);
146146

147147
span_lint(cx,

clippy_lints/src/let_if_seq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for UsedVisitor<'a, 'tcx> {
145145
hir::intravisit::walk_expr(self, expr);
146146
}
147147
fn nested_visit_map<'this>(&'this mut self) -> hir::intravisit::NestedVisitorMap<'this, 'tcx> {
148-
hir::intravisit::NestedVisitorMap::All(&self.cx.tcx.map)
148+
hir::intravisit::NestedVisitorMap::All(&self.cx.tcx.hir)
149149
}
150150
}
151151

clippy_lints/src/loops.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ fn check_for_loop_explicit_counter<'a, 'tcx>(
677677

678678
// For each candidate, check the parent block to see if
679679
// it's initialized to zero at the start of the loop.
680-
let map = &cx.tcx.map;
680+
let map = &cx.tcx.hir;
681681
let parent_scope = map.get_enclosing_scope(expr.id).and_then(|id| map.get_enclosing_scope(id));
682682
if let Some(parent_id) = parent_scope {
683683
if let NodeBlock(block) = map.get(parent_id) {
@@ -794,7 +794,7 @@ impl<'a, 'tcx: 'a> Visitor<'tcx> for UsedVisitor<'a, 'tcx> {
794794
walk_expr(self, expr);
795795
}
796796
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
797-
NestedVisitorMap::All(&self.cx.tcx.map)
797+
NestedVisitorMap::All(&self.cx.tcx.hir)
798798
}
799799
}
800800

@@ -822,7 +822,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
822822
match def {
823823
Def::Local(..) | Def::Upvar(..) => {
824824
let def_id = def.def_id();
825-
let node_id = self.cx.tcx.map.as_local_node_id(def_id).unwrap();
825+
let node_id = self.cx.tcx.hir.as_local_node_id(def_id).unwrap();
826826

827827
let extent = self.cx.tcx.region_maps.var_scope(node_id);
828828
self.indexed.insert(seqvar.segments[0].name, Some(extent));
@@ -844,7 +844,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
844844
walk_expr(self, expr);
845845
}
846846
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
847-
NestedVisitorMap::All(&self.cx.tcx.map)
847+
NestedVisitorMap::All(&self.cx.tcx.hir)
848848
}
849849
}
850850

@@ -886,7 +886,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarUsedAfterLoopVisitor<'a, 'tcx> {
886886
walk_expr(self, expr);
887887
}
888888
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
889-
NestedVisitorMap::All(&self.cx.tcx.map)
889+
NestedVisitorMap::All(&self.cx.tcx.hir)
890890
}
891891
}
892892

@@ -1029,7 +1029,7 @@ impl<'a, 'tcx> Visitor<'tcx> for IncrementVisitor<'a, 'tcx> {
10291029
walk_expr(self, expr);
10301030
}
10311031
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
1032-
NestedVisitorMap::All(&self.cx.tcx.map)
1032+
NestedVisitorMap::All(&self.cx.tcx.hir)
10331033
}
10341034
}
10351035

@@ -1116,15 +1116,15 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
11161116
walk_expr(self, expr);
11171117
}
11181118
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
1119-
NestedVisitorMap::All(&self.cx.tcx.map)
1119+
NestedVisitorMap::All(&self.cx.tcx.hir)
11201120
}
11211121
}
11221122

11231123
fn var_def_id(cx: &LateContext, expr: &Expr) -> Option<NodeId> {
11241124
if let ExprPath(ref qpath) = expr.node {
11251125
let path_res = cx.tables.qpath_def(qpath, expr.id);
11261126
if let Def::Local(def_id) = path_res {
1127-
let node_id = cx.tcx.map.as_local_node_id(def_id).expect("That DefId should be valid");
1127+
let node_id = cx.tcx.hir.as_local_node_id(def_id).expect("That DefId should be valid");
11281128
return Some(node_id);
11291129
}
11301130
}

clippy_lints/src/map_clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
3131
if &*name.node.as_str() == "map" && args.len() == 2 {
3232
match args[1].node {
3333
ExprClosure(_, ref decl, closure_eid, _) => {
34-
let body = cx.tcx.map.body(closure_eid);
34+
let body = cx.tcx.hir.body(closure_eid);
3535
let closure_expr = remove_blocks(&body.value);
3636
if_let_chain! {[
3737
// nothing special in the argument, besides reference bindings

clippy_lints/src/methods.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
614614
return;
615615
}
616616
let name = implitem.name;
617-
let parent = cx.tcx.map.get_parent(implitem.id);
618-
let item = cx.tcx.map.expect_item(parent);
617+
let parent = cx.tcx.hir.get_parent(implitem.id);
618+
let item = cx.tcx.hir.expect_item(parent);
619619
if_let_chain! {[
620620
let hir::ImplItemKind::Method(ref sig, id) = implitem.node,
621621
let Some(first_arg_ty) = sig.decl.inputs.get(0),
622-
let Some(first_arg) = iter_input_pats(&sig.decl, cx.tcx.map.body(id)).next(),
622+
let Some(first_arg) = iter_input_pats(&sig.decl, cx.tcx.hir.body(id)).next(),
623623
let hir::ItemImpl(_, _, _, None, ref self_ty, _) = item.node,
624624
], {
625625
// check missing trait implementations
@@ -635,7 +635,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
635635
}
636636

637637
// check conventions w.r.t. conversion method names and predicates
638-
let ty = cx.tcx.item_type(cx.tcx.map.local_def_id(item.id));
638+
let ty = cx.tcx.item_type(cx.tcx.hir.local_def_id(item.id));
639639
let is_copy = is_copy(cx, ty, item.id);
640640
for &(ref conv, self_kinds) in &CONVENTIONS {
641641
if_let_chain! {[
@@ -798,7 +798,7 @@ fn lint_or_fun_call(cx: &LateContext, expr: &hir::Expr, name: &str, args: &[hir:
798798
/// Checks for the `CLONE_ON_COPY` lint.
799799
fn lint_clone_on_copy(cx: &LateContext, expr: &hir::Expr, arg: &hir::Expr, arg_ty: ty::Ty) {
800800
let ty = cx.tables.expr_ty(expr);
801-
let parent = cx.tcx.map.get_parent(expr.id);
801+
let parent = cx.tcx.hir.get_parent(expr.id);
802802
let parameter_environment = ty::ParameterEnvironment::for_item(cx.tcx, parent);
803803
if let ty::TyRef(_, ty::TypeAndMut { ty: inner, .. }) = arg_ty.sty {
804804
if let ty::TyRef(..) = inner.sty {

clippy_lints/src/misc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ fn non_macro_local(cx: &LateContext, def: &def::Def) -> bool {
477477
match *def {
478478
def::Def::Local(id) |
479479
def::Def::Upvar(id, _, _) => {
480-
if let Some(span) = cx.tcx.map.span_if_local(id) {
480+
if let Some(span) = cx.tcx.hir.span_if_local(id) {
481481
!in_macro(cx, span)
482482
} else {
483483
true

clippy_lints/src/missing_doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
146146

147147
fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx hir::ImplItem) {
148148
// If the method is an impl for a trait, don't doc.
149-
let def_id = cx.tcx.map.local_def_id(impl_item.id);
149+
let def_id = cx.tcx.hir.local_def_id(impl_item.id);
150150
match cx.tcx.associated_item(def_id).container {
151151
ty::TraitContainer(_) => return,
152152
ty::ImplContainer(cid) => {

0 commit comments

Comments
 (0)