]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/types/borrowed_box.rs
Auto merge of #83500 - camelid:split-debuginfo-docs-cleanup, r=steveklabnik
[rust.git] / src / tools / clippy / clippy_lints / src / types / borrowed_box.rs
index a7a511b21cf59020af650c10296ce43f9eecc7d8..d68c6db4e23343b4055b4a0f55ee1190aa400616 100644 (file)
@@ -1,3 +1,7 @@
+use clippy_utils::diagnostics::span_lint_and_sugg;
+use clippy_utils::source::snippet;
+use clippy_utils::{match_path, paths};
+use if_chain::if_chain;
 use rustc_errors::Applicability;
 use rustc_hir::{
     self as hir, GenericArg, GenericBounds, GenericParamKind, HirId, Lifetime, MutTy, Mutability, Node, QPath,
@@ -5,10 +9,6 @@
 };
 use rustc_lint::LateContext;
 
-use if_chain::if_chain;
-
-use crate::utils::{match_path, paths, snippet, span_lint_and_sugg};
-
 use super::BORROWED_BOX;
 
 pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, mut_ty: &MutTy<'_>) -> bool {
@@ -50,7 +50,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, m
                     // Originally reported as the issue #3128.
                     let inner_snippet = snippet(cx, inner.span, "..");
                     let suggestion = match &inner.kind {
-                        TyKind::TraitObject(bounds, lt_bound) if bounds.len() > 1 || !lt_bound.is_elided() => {
+                        TyKind::TraitObject(bounds, lt_bound, _) if bounds.len() > 1 || !lt_bound.is_elided() => {
                             format!("&{}({})", ltopt, &inner_snippet)
                         },
                         TyKind::Path(qpath)
@@ -86,7 +86,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, m
 // Returns true if given type is `Any` trait.
 fn is_any_trait(t: &hir::Ty<'_>) -> bool {
     if_chain! {
-        if let TyKind::TraitObject(ref traits, _) = t.kind;
+        if let TyKind::TraitObject(ref traits, ..) = t.kind;
         if !traits.is_empty();
         // Only Send/Sync can be used as additional traits, so it is enough to
         // check only the first trait.