]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_lint/src/noop_method_call.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / compiler / rustc_lint / src / noop_method_call.rs
index 600504f7c1280973c018386ecc2afacba0fb2fbc..39b5b7afdaef1dbf4c4e2fc019559afbe9dd00f3 100644 (file)
@@ -40,7 +40,7 @@ declare_lint_pass!(NoopMethodCall => [NOOP_METHOD_CALL]);
 impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
         // We only care about method calls.
-        let ExprKind::MethodCall(call, _, elements, _) = &expr.kind else {
+        let ExprKind::MethodCall(call, elements, _) = &expr.kind else {
             return
         };
         // We only care about method calls corresponding to the `Clone`, `Deref` and `Borrow`
@@ -62,7 +62,7 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
             _ => return,
         };
         let substs = cx.typeck_results().node_substs(expr.hir_id);
-        if substs.definitely_needs_subst(cx.tcx) {
+        if substs.needs_subst() {
             // We can't resolve on types that require monomorphization, so we don't handle them if
             // we need to perfom substitution.
             return;