X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_lint%2Fsrc%2Funused.rs;h=43864ed45fae224c5ac60339e84e1eb4399c4557;hb=5fa44b54641cac7dc47964870d08b4ec82fc8157;hp=d6a01b425483129a1ff9a8d9c4139c246ed0cbd4;hpb=5dfb4b0afaf6acace0845d00e85a934fb4289d83;p=rust.git diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index d6a01b42548..43864ed45fa 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -258,8 +258,9 @@ fn is_ty_must_use<'tcx>( ) .filter_map(|obligation| { // We only look at the `DefId`, so it is safe to skip the binder here. - if let ty::PredicateKind::Trait(ref poly_trait_predicate) = - obligation.predicate.kind().skip_binder() + if let ty::PredicateKind::Clause(ty::Clause::Trait( + ref poly_trait_predicate, + )) = obligation.predicate.kind().skip_binder() { let def_id = poly_trait_predicate.trait_ref.def_id; @@ -1015,6 +1016,7 @@ fn check_ty(&mut self, cx: &EarlyContext<'_>, ty: &ast::Ty) { if let ast::TyKind::Paren(r) = &ty.kind { match &r.kind { ast::TyKind::TraitObject(..) => {} + ast::TyKind::BareFn(b) if b.generic_params.len() > 0 => {} ast::TyKind::ImplTrait(_, bounds) if bounds.len() > 1 => {} ast::TyKind::Array(_, len) => { self.check_unused_delims_expr(