ty::Opaque(def, _) => {
let mut has_emitted = false;
for (predicate, _) in cx.tcx.predicates_of(def).predicates {
- if let ty::Predicate::Trait(ref poly_trait_predicate) = predicate {
+ if let ty::Predicate::Trait(ref poly_trait_predicate, _) = predicate {
let trait_ref = poly_trait_predicate.skip_binder().trait_ref;
let def_id = trait_ref.def_id;
let descr_pre =
}
fn check_stmt(&mut self, cx: &EarlyContext<'_>, s: &ast::Stmt) {
- if let ast::StmtKind::Local(ref local) = s.kind {
- self.check_unused_parens_pat(cx, &local.pat, false, false);
+ use ast::StmtKind::*;
- if let Some(ref value) = local.init {
- self.check_unused_parens_expr(cx, &value, "assigned value", false, None, None);
+ match s.kind {
+ Local(ref local) => {
+ self.check_unused_parens_pat(cx, &local.pat, false, false);
+
+ if let Some(ref value) = local.init {
+ self.check_unused_parens_expr(cx, &value, "assigned value", false, None, None);
+ }
}
+ Expr(ref expr) => {
+ self.check_unused_parens_expr(cx, &expr, "block return value", false, None, None);
+ }
+ _ => {}
}
}