redundant_allocation: fix 7487
This commit is contained in:
parent
1fc1aee7be
commit
641be558fc
3 changed files with 37 additions and 2 deletions
|
|
@ -54,7 +54,13 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
|
|||
_ => return false,
|
||||
};
|
||||
let inner_span = match get_qpath_generic_tys(inner_qpath).next() {
|
||||
Some(ty) => ty.span,
|
||||
Some(ty) => {
|
||||
// Box<Box<dyn T>> is smaller than Box<dyn T> because of wide pointers
|
||||
if matches!(ty.kind, TyKind::TraitObject(..)) {
|
||||
return false;
|
||||
}
|
||||
ty.span
|
||||
},
|
||||
None => return false,
|
||||
};
|
||||
if inner_sym == outer_sym {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue