]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/functions.rs
Auto merge of #3946 - rchaser53:issue-3920, r=flip1995
[rust.git] / clippy_lints / src / functions.rs
index 5378f7d455f7e651bda51b4f470137961f888ece..307f03c692807cf3b7df4d2779c9a760cb65019a 100644 (file)
@@ -256,8 +256,7 @@ fn check_raw_ptr(
         hir_id: hir::HirId,
     ) {
         let expr = &body.value;
-        let node_id = cx.tcx.hir().hir_to_node_id(hir_id);
-        if unsafety == hir::Unsafety::Normal && cx.access_levels.is_exported(node_id) {
+        if unsafety == hir::Unsafety::Normal && cx.access_levels.is_exported(hir_id) {
             let raw_ptrs = iter_input_pats(decl, body)
                 .zip(decl.inputs.iter())
                 .filter_map(|(arg, ty)| raw_ptr_arg(arg, ty))
@@ -304,7 +303,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
                 }
             },
             hir::ExprKind::MethodCall(_, _, ref args) => {
-                let def_id = self.tables.type_dependent_defs()[expr.hir_id].def_id();
+                let def_id = self.tables.type_dependent_def_id(expr.hir_id).unwrap();
                 let base_type = self.cx.tcx.type_of(def_id);
 
                 if type_is_unsafe_function(self.cx, base_type) {