Use cx.access_levels.exported() instead of visibility
This commit is contained in:
parent
31f16b87b7
commit
a4f45e85b1
2 changed files with 9 additions and 12 deletions
|
@ -1453,15 +1453,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidUpcastComparisons {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **What it does:** Checks for `impl` or `fn` missing generalization over
|
/// **What it does:** Checks for public `impl` or `fn` missing generalization over
|
||||||
/// different hashers and implicitly defaulting to the default hashing
|
/// different hashers and implicitly defaulting to the default hashing
|
||||||
/// algorithm (SipHash). This lint ignores private free-functions.
|
/// algorithm (SipHash).
|
||||||
///
|
///
|
||||||
/// **Why is this bad?** `HashMap` or `HashSet` with custom hashers cannot be
|
/// **Why is this bad?** `HashMap` or `HashSet` with custom hashers cannot be
|
||||||
/// used with them.
|
/// used with them.
|
||||||
///
|
///
|
||||||
/// **Known problems:** Suggestions for replacing constructors contains
|
/// **Known problems:** Suggestions for replacing constructors can contain
|
||||||
/// false-positives. Also applying suggestion can require modification of other
|
/// false-positives. Also applying suggestions can require modification of other
|
||||||
/// pieces of code, possibly including external crates.
|
/// pieces of code, possibly including external crates.
|
||||||
///
|
///
|
||||||
/// **Example:**
|
/// **Example:**
|
||||||
|
@ -1530,9 +1530,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher {
|
||||||
if !vis.suggestions.is_empty() {
|
if !vis.suggestions.is_empty() {
|
||||||
multispan_sugg(db, "...and use generic constructor".into(), vis.suggestions);
|
multispan_sugg(db, "...and use generic constructor".into(), vis.suggestions);
|
||||||
}
|
}
|
||||||
// for (span, sugg) in vis.suggestions {
|
}
|
||||||
// db.span_suggestion(span, "...and use generic constructor here", sugg);
|
|
||||||
// }
|
if !cx.access_levels.is_exported(item.id) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
match item.node {
|
match item.node {
|
||||||
|
@ -1565,10 +1566,6 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ItemFn(ref decl, .., ref generics, body_id) => {
|
ItemFn(ref decl, .., ref generics, body_id) => {
|
||||||
if item.vis != Public {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let body = cx.tcx.hir.body(body_id);
|
let body = cx.tcx.hir.body(body_id);
|
||||||
|
|
||||||
for ty in &decl.inputs {
|
for ty in &decl.inputs {
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::collections::{HashMap, HashSet};
|
||||||
use std::cmp::Eq;
|
use std::cmp::Eq;
|
||||||
use std::hash::{Hash, BuildHasher};
|
use std::hash::{Hash, BuildHasher};
|
||||||
|
|
||||||
trait Foo<T>: Sized {
|
pub trait Foo<T>: Sized {
|
||||||
fn make() -> (Self, Self);
|
fn make() -> (Self, Self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue