Skip to content

Commit 7853dac

Browse files
committed
Responded to comments and fixed compile bug
Removed the hash of `let c: fn(_,_) -> _ = ExprKind::Cast` and fixed compile issue by collecting HirVec into an actual Vec
1 parent c025917 commit 7853dac

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

clippy_lints/src/trait_bounds.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::utils::{in_macro, span_help_and_lint, SpanlessHash};
22
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
3-
use rustc::{declare_tool_lint, lint_array, impl_lint_pass};
3+
use rustc::{declare_tool_lint, impl_lint_pass};
44
use rustc_data_structures::fx::FxHashMap;
55
use rustc::hir::*;
66

@@ -29,7 +29,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TraitBounds {
2929
for bound in &gen.where_clause.predicates {
3030
if let WherePredicate::BoundPredicate(ref p) = bound {
3131
let h = hash(&p.bounded_ty);
32-
if let Some(ref v) = map.insert(h, p.bounds) {
32+
if let Some(ref v) = map.insert(h, p.bounds.iter().collect::<Vec<_>>()) {
3333
let mut hint_string = format!("consider combining the bounds: `{:?}: ", p.bounded_ty);
3434
for b in v.iter() {
3535
hint_string.push_str(&format!("{:?}, ", b));

clippy_lints/src/utils/hir_utils.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::utils::differing_macro_contexts;
33
use rustc::hir::ptr::P;
44
use rustc::hir::*;
55
use rustc::lint::LateContext;
6-
use rustc::ty::{self, TypeckTables};
6+
use rustc::ty::TypeckTables;
77
use std::collections::hash_map::DefaultHasher;
88
use std::hash::{Hash, Hasher};
99
use syntax::ast::Name;
@@ -439,8 +439,6 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
439439
self.hash_exprs(args);
440440
},
441441
ExprKind::Cast(ref e, ref ty) => {
442-
let c: fn(_, _) -> _ = ExprKind::Cast;
443-
c.hash(&mut self.s);
444442
self.hash_expr(e);
445443
self.hash_ty(ty);
446444
},

0 commit comments

Comments
 (0)