This commit is contained in:
Oliver Schneider 2018-07-02 19:07:12 +02:00
parent 41972f89dc
commit 141f79f844
4 changed files with 13 additions and 13 deletions

View File

@ -44,7 +44,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse {
impl EnumGlobUse {
fn lint_item(&self, cx: &LateContext, item: &Item) {
if item.vis == Visibility::Public {
if item.vis.node == VisibilityKind::Public {
return; // re-exports are fine
}
if let ItemUse(ref path, UseKind::Glob) = item.node {

View File

@ -840,7 +840,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
.iter()
.any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &implitem.generics));
then {
let lint = if item.vis == hir::Visibility::Public {
let lint = if item.vis.node == hir::VisibilityKind::Public {
WRONG_PUB_SELF_CONVENTION
} else {
WRONG_SELF_CONVENTION

View File

@ -51,14 +51,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
return;
}
println!("impl item `{}`", item.ident.name);
match item.vis {
hir::Visibility::Public => println!("public"),
hir::Visibility::Crate(_) => println!("visible crate wide"),
hir::Visibility::Restricted { ref path, .. } => println!(
match item.vis.node {
hir::VisibilityKind::Public => println!("public"),
hir::VisibilityKind::Crate(_) => println!("visible crate wide"),
hir::VisibilityKind::Restricted { ref path, .. } => println!(
"visible in module `{}`",
print::to_string(print::NO_ANN, |s| s.print_path(path, false))
),
hir::Visibility::Inherited => println!("visibility inherited from outer item"),
hir::VisibilityKind::Inherited => println!("visibility inherited from outer item"),
}
if item.defaultness.is_default() {
println!("default");
@ -343,14 +343,14 @@ fn print_expr(cx: &LateContext, expr: &hir::Expr, indent: usize) {
fn print_item(cx: &LateContext, item: &hir::Item) {
let did = cx.tcx.hir.local_def_id(item.id);
println!("item `{}`", item.name);
match item.vis {
hir::Visibility::Public => println!("public"),
hir::Visibility::Crate(_) => println!("visible crate wide"),
hir::Visibility::Restricted { ref path, .. } => println!(
match item.vis.node {
hir::VisibilityKind::Public => println!("public"),
hir::VisibilityKind::Crate(_) => println!("visible crate wide"),
hir::VisibilityKind::Restricted { ref path, .. } => println!(
"visible in module `{}`",
print::to_string(print::NO_ANN, |s| s.print_path(path, false))
),
hir::Visibility::Inherited => println!("visibility inherited from outer item"),
hir::VisibilityKind::Inherited => println!("visibility inherited from outer item"),
}
match item.node {
hir::ItemExternCrate(ref _renamed_from) => {

View File

@ -120,7 +120,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
if let ItemStatic(ref ty, MutImmutable, body_id) = item.node {
if is_lint_ref_type(ty) {
self.declared_lints.insert(item.name, item.span);
} else if is_lint_array_type(ty) && item.vis == Visibility::Inherited && item.name == "ARRAY" {
} else if is_lint_array_type(ty) && item.vis.node == VisibilityKind::Inherited && item.name == "ARRAY" {
let mut collector = LintCollector {
output: &mut self.registered_lints,
cx,