diff --git a/clippy_lints/src/trait_bounds.rs b/clippy_lints/src/trait_bounds.rs index cb836eac3a6f..3ef353a978fa 100644 --- a/clippy_lints/src/trait_bounds.rs +++ b/clippy_lints/src/trait_bounds.rs @@ -32,10 +32,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TraitBounds { if let Some(ref v) = map.insert(h, p.bounds.iter().collect::>()) { let mut hint_string = format!("consider combining the bounds: `{:?}: ", p.bounded_ty); for b in v.iter() { - hint_string.push_str(&format!("{:?}, ", b)); + if let GenericBound::Trait(ref poly_trait_ref, _) = b { + let path = &poly_trait_ref.trait_ref.path; + hint_string.push_str(&format!("{}, ", path)); + } } for b in p.bounds.iter() { - hint_string.push_str(&format!("{:?}, ", b)); + if let GenericBound::Trait(ref poly_trait_ref, _) = b { + let path = &poly_trait_ref.trait_ref.path; + hint_string.push_str(&format!("{}, ", path)); + } } hint_string.truncate(hint_string.len() - 2); hint_string.push('`'); diff --git a/clippy_lints/src/utils/hir_utils.rs b/clippy_lints/src/utils/hir_utils.rs index 703c9fac1dac..449b8c4397da 100644 --- a/clippy_lints/src/utils/hir_utils.rs +++ b/clippy_lints/src/utils/hir_utils.rs @@ -513,18 +513,12 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> { } }, ExprKind::Tup(ref tup) => { - let c: fn(_) -> _ = ExprKind::Tup; - c.hash(&mut self.s); self.hash_exprs(tup); }, ExprKind::Array(ref v) => { - let c: fn(_) -> _ = ExprKind::Array; - c.hash(&mut self.s); self.hash_exprs(v); }, ExprKind::Type(ref e, ref ty) => { - let c: fn(_, _) -> _ = ExprKind::Type; - c.hash(&mut self.s); self.hash_expr(e); self.hash_ty(ty); },