Skip to content

Commit a3c77f6

Browse files
authored
Merge pull request #3512 from matthiaskrgr/rustup
rustup #56502 ( .hir -> .hir() )
2 parents 26602dd + d93ea1e commit a3c77f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+182
-169
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ before_install:
3030
install:
3131
- |
3232
if [ -z ${INTEGRATION} ]; then
33-
rustup component add rustfmt-preview || cargo install --git https://github.com/rust-lang/rustfmt/ --force
33+
rustup component add rustfmt || cargo install --git https://github.com/rust-lang/rustfmt/ --force
3434
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
3535
. $HOME/.nvm/nvm.sh
3636
nvm install stable

clippy_lints/src/arithmetic.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
121121
}
122122

123123
fn check_body(&mut self, cx: &LateContext<'_, '_>, body: &hir::Body) {
124-
let body_owner = cx.tcx.hir.body_owner(body.id());
124+
let body_owner = cx.tcx.hir().body_owner(body.id());
125125

126-
match cx.tcx.hir.body_owner_kind(body_owner) {
126+
match cx.tcx.hir().body_owner_kind(body_owner) {
127127
hir::BodyOwnerKind::Static(_) | hir::BodyOwnerKind::Const => {
128-
let body_span = cx.tcx.hir.span(body_owner);
128+
let body_span = cx.tcx.hir().span(body_owner);
129129

130130
if let Some(span) = self.const_span {
131131
if span.contains(body_span) {
@@ -139,8 +139,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
139139
}
140140

141141
fn check_body_post(&mut self, cx: &LateContext<'_, '_>, body: &hir::Body) {
142-
let body_owner = cx.tcx.hir.body_owner(body.id());
143-
let body_span = cx.tcx.hir.span(body_owner);
142+
let body_owner = cx.tcx.hir().body_owner(body.id());
143+
let body_span = cx.tcx.hir().span(body_owner);
144144

145145
if let Some(span) = self.const_span {
146146
if span.contains(body_span) {

clippy_lints/src/assign_ops.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
144144
return; // useless if the trait doesn't exist
145145
};
146146
// check that we are not inside an `impl AssignOp` of this exact operation
147-
let parent_fn = cx.tcx.hir.get_parent(e.id);
148-
let parent_impl = cx.tcx.hir.get_parent(parent_fn);
147+
let parent_fn = cx.tcx.hir().get_parent(e.id);
148+
let parent_impl = cx.tcx.hir().get_parent(parent_fn);
149149
// the crate node is the only one that is not in the map
150150
if_chain! {
151151
if parent_impl != ast::CRATE_NODE_ID;
152-
if let hir::Node::Item(item) = cx.tcx.hir.get(parent_impl);
152+
if let hir::Node::Item(item) = cx.tcx.hir().get(parent_impl);
153153
if let hir::ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) =
154154
item.node;
155155
if trait_ref.path.def.def_id() == trait_id;

clippy_lints/src/attrs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,15 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
354354

355355
fn is_relevant_item(tcx: TyCtxt<'_, '_, '_>, item: &Item) -> bool {
356356
if let ItemKind::Fn(_, _, _, eid) = item.node {
357-
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value)
357+
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir().body(eid).value)
358358
} else {
359359
true
360360
}
361361
}
362362

363363
fn is_relevant_impl(tcx: TyCtxt<'_, '_, '_>, item: &ImplItem) -> bool {
364364
match item.node {
365-
ImplItemKind::Method(_, eid) => is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value),
365+
ImplItemKind::Method(_, eid) => is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir().body(eid).value),
366366
_ => false,
367367
}
368368
}
@@ -371,7 +371,7 @@ fn is_relevant_trait(tcx: TyCtxt<'_, '_, '_>, item: &TraitItem) -> bool {
371371
match item.node {
372372
TraitItemKind::Method(_, TraitMethod::Required(_)) => true,
373373
TraitItemKind::Method(_, TraitMethod::Provided(eid)) => {
374-
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir.body(eid).value)
374+
is_relevant_expr(tcx, tcx.body_tables(eid), &tcx.hir().body(eid).value)
375375
},
376376
_ => false,
377377
}

clippy_lints/src/block_in_if_condition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct ExVisitor<'a, 'tcx: 'a> {
6868
impl<'a, 'tcx: 'a> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
6969
fn visit_expr(&mut self, expr: &'tcx Expr) {
7070
if let ExprKind::Closure(_, _, eid, _, _) = expr.node {
71-
let body = self.cx.tcx.hir.body(eid);
71+
let body = self.cx.tcx.hir().body(eid);
7272
let ex = &body.value;
7373
if matches!(ex.node, ExprKind::Block(_, _)) && !in_macro(body.value.span) {
7474
self.found_block = Some(ex);

clippy_lints/src/bytecount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ByteCount {
6060
if filter_args.len() == 2;
6161
if let ExprKind::Closure(_, _, body_id, _, _) = filter_args[1].node;
6262
then {
63-
let body = cx.tcx.hir.body(body_id);
63+
let body = cx.tcx.hir().body(body_id);
6464
if_chain! {
6565
if body.arguments.len() == 1;
6666
if let Some(argname) = get_pat_name(&body.arguments[0].pat);

clippy_lints/src/copy_iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl LintPass for CopyIterator {
4949
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CopyIterator {
5050
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
5151
if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.node {
52-
let ty = cx.tcx.type_of(cx.tcx.hir.local_def_id(item.id));
52+
let ty = cx.tcx.type_of(cx.tcx.hir().local_def_id(item.id));
5353

5454
if is_copy(cx, ty) && match_path(&trait_ref.path, &paths::ITERATOR) {
5555
span_note_and_lint(

clippy_lints/src/cyclomatic_complexity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CyclomaticComplexity {
130130
span: Span,
131131
node_id: NodeId,
132132
) {
133-
let def_id = cx.tcx.hir.local_def_id(node_id);
133+
let def_id = cx.tcx.hir().local_def_id(node_id);
134134
if !cx.tcx.has_attr(def_id, "test") {
135135
self.check(cx, body, span);
136136
}

clippy_lints/src/derive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl LintPass for Derive {
8282
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Derive {
8383
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
8484
if let ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) = item.node {
85-
let ty = cx.tcx.type_of(cx.tcx.hir.local_def_id(item.id));
85+
let ty = cx.tcx.type_of(cx.tcx.hir().local_def_id(item.id));
8686
let is_automatically_derived = is_automatically_derived(&*item.attrs);
8787

8888
check_hash_peq(cx, item.span, trait_ref, ty, is_automatically_derived);
@@ -129,9 +129,9 @@ fn check_hash_peq<'a, 'tcx>(
129129
cx, DERIVE_HASH_XOR_EQ, span,
130130
mess,
131131
|db| {
132-
if let Some(node_id) = cx.tcx.hir.as_local_node_id(impl_id) {
132+
if let Some(node_id) = cx.tcx.hir().as_local_node_id(impl_id) {
133133
db.span_note(
134-
cx.tcx.hir.span(node_id),
134+
cx.tcx.hir().span(node_id),
135135
"`PartialEq` implemented here"
136136
);
137137
}

clippy_lints/src/empty_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl LintPass for EmptyEnum {
4343

4444
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EmptyEnum {
4545
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item) {
46-
let did = cx.tcx.hir.local_def_id(item.id);
46+
let did = cx.tcx.hir().local_def_id(item.id);
4747
if let ItemKind::Enum(..) = item.node {
4848
let ty = cx.tcx.type_of(did);
4949
let adt = ty.ty_adt_def().expect("already checked whether this is an enum");

0 commit comments

Comments
 (0)