]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #4215 - matthiaskrgr:rustup_9, r=flip1995
authorbors <bors@rust-lang.org>
Tue, 18 Jun 2019 10:05:04 +0000 (10:05 +0000)
committerbors <bors@rust-lang.org>
Tue, 18 Jun 2019 10:05:04 +0000 (10:05 +0000)
rustup https://github.com/rust-lang/rust/pull/61836/

changelog: none

clippy_lints/src/derive.rs
clippy_lints/src/enum_glob_use.rs
clippy_lints/src/escape.rs
clippy_lints/src/lifetimes.rs
clippy_lints/src/methods/mod.rs
clippy_lints/src/misc.rs
clippy_lints/src/new_without_default.rs
clippy_lints/src/non_copy_const.rs
clippy_lints/src/utils/mod.rs

index bf2845af13367e49cf6e4c5bad27a3773153a9a9..68f235309ba8c1df7ea8fdda70660fa6e62a9f26 100644 (file)
@@ -114,7 +114,7 @@ fn check_hash_peq<'a, 'tcx>(
                         cx, DERIVE_HASH_XOR_EQ, span,
                         mess,
                         |db| {
-                        if let Some(node_id) = cx.tcx.hir().as_local_node_id(impl_id) {
+                        if let Some(node_id) = cx.tcx.hir().as_local_hir_id(impl_id) {
                             db.span_note(
                                 cx.tcx.hir().span(node_id),
                                 "`PartialEq` implemented here"
index d658e9baf5dbeb050e2a2582b950de46e44db1c0..489eb6dade8fab1f22c58fc97851b10009206d87 100644 (file)
@@ -32,7 +32,7 @@ fn check_mod(&mut self, cx: &LateContext<'a, 'tcx>, m: &'tcx Mod, _: Span, _: Hi
         let map = cx.tcx.hir();
         // only check top level `use` statements
         for item in &m.item_ids {
-            self.lint_item(cx, map.expect_item(map.hir_to_node_id(item.id)));
+            self.lint_item(cx, map.expect_item(item.id));
         }
     }
 }
index 41312101417ae3f68056149277685da0aad3c92b..9106c15579634acb28ed5599efda1a214909582a 100644 (file)
@@ -94,7 +94,7 @@ fn check_fn(
             span_lint(
                 cx,
                 BOXED_LOCAL,
-                cx.tcx.hir().span_by_hir_id(node),
+                cx.tcx.hir().span(node),
                 "local variable doesn't need to be boxed here",
             );
         }
index 8c167db913159727c3c9c6e4d00cbd797f6d2451..c3446b1ed7aed525971e9cbbc919c82bcbac26db 100644 (file)
@@ -346,7 +346,7 @@ fn visit_ty(&mut self, ty: &'tcx Ty) {
             },
             TyKind::Def(item, _) => {
                 let map = self.cx.tcx.hir();
-                if let ItemKind::Existential(ref exist_ty) = map.expect_item(map.hir_to_node_id(item.id)).node {
+                if let ItemKind::Existential(ref exist_ty) = map.expect_item(item.id).node {
                     for bound in &exist_ty.bounds {
                         if let GenericBound::Outlives(_) = *bound {
                             self.record(&None);
index 1e7ff4907ae68c44f94e4d3db4ab0da8ee59848d..d91d7ecc2b8e1d4ad03a03fcce60e9178a610dfd 100644 (file)
@@ -947,7 +947,7 @@ fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, implitem: &'tcx hir::I
         }
         let name = implitem.ident.name.as_str();
         let parent = cx.tcx.hir().get_parent_item(implitem.hir_id);
-        let item = cx.tcx.hir().expect_item_by_hir_id(parent);
+        let item = cx.tcx.hir().expect_item(parent);
         let def_id = cx.tcx.hir().local_def_id_from_hir_id(item.hir_id);
         let ty = cx.tcx.type_of(def_id);
         if_chain! {
@@ -1070,7 +1070,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
 
             if call_found {
                 // don't lint for constant values
-                let owner_def = self.cx.tcx.hir().get_parent_did_by_hir_id(expr.hir_id);
+                let owner_def = self.cx.tcx.hir().get_parent_did(expr.hir_id);
                 let promotable = self
                     .cx
                     .tcx
index bb43b894cd0954b7626263b5025b9e4369120981..d77f71c2ab23612a9b4cbca2d90262e85a52b3b0 100644 (file)
@@ -605,7 +605,7 @@ fn in_attributes_expansion(expr: &Expr) -> bool {
 /// Tests whether `res` is a variable defined outside a macro.
 fn non_macro_local(cx: &LateContext<'_, '_>, res: def::Res) -> bool {
     if let def::Res::Local(id) = res {
-        !in_macro_or_desugar(cx.tcx.hir().span_by_hir_id(id))
+        !in_macro_or_desugar(cx.tcx.hir().span(id))
     } else {
         false
     }
index 747548328264c691423de3c254ea7368878de0de..723c1a997bbb91d74f0ab8048ddab9a53e825711 100644 (file)
@@ -146,8 +146,9 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
                                         if let Some(self_def) = cx.tcx.type_of(self_did).ty_adt_def();
                                         if self_def.did.is_local();
                                         then {
-                                            let self_id = cx.tcx.hir().local_def_id_to_node_id(self_def.did.to_local());
-                                            if impling_types.contains(&self_id) {
+                                            let self_id = cx.tcx.hir().local_def_id_to_hir_id(self_def.did.to_local());
+                                            let node_id = cx.tcx.hir().hir_to_node_id(self_id);
+                                            if impling_types.contains(&node_id) {
                                                 return;
                                             }
                                         }
index 5aaa279941e7bed214355be480c21cb9938cf390..832452a0e4d30e5b79acf9636fb0481ad3ba5769 100644 (file)
@@ -170,7 +170,7 @@ fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, trait_item: &'tcx Tra
     fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem) {
         if let ImplItemKind::Const(hir_ty, ..) = &impl_item.node {
             let item_hir_id = cx.tcx.hir().get_parent_node_by_hir_id(impl_item.hir_id);
-            let item = cx.tcx.hir().expect_item_by_hir_id(item_hir_id);
+            let item = cx.tcx.hir().expect_item(item_hir_id);
             // Ensure the impl is an inherent impl.
             if let ItemKind::Impl(_, _, _, _, None, _, _) = item.node {
                 let ty = hir_ty_to_ty(cx.tcx, hir_ty);
index 5554b5a5727a1367f306e7c314c86ce81f841311..afaaa9e81c60a0ff7064768cd0c680ee4ab415a6 100644 (file)
@@ -978,7 +978,7 @@ pub fn any_parent_is_automatically_derived(tcx: TyCtxt<'_>, node: HirId) -> bool
     let mut prev_enclosing_node = None;
     let mut enclosing_node = node;
     while Some(enclosing_node) != prev_enclosing_node {
-        if is_automatically_derived(map.attrs_by_hir_id(enclosing_node)) {
+        if is_automatically_derived(map.attrs(enclosing_node)) {
             return true;
         }
         prev_enclosing_node = Some(enclosing_node);