mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 20:28:33 +00:00
Rustup
This commit is contained in:
parent
41972f89dc
commit
141f79f844
@ -44,7 +44,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EnumGlobUse {
|
|||||||
|
|
||||||
impl EnumGlobUse {
|
impl EnumGlobUse {
|
||||||
fn lint_item(&self, cx: &LateContext, item: &Item) {
|
fn lint_item(&self, cx: &LateContext, item: &Item) {
|
||||||
if item.vis == Visibility::Public {
|
if item.vis.node == VisibilityKind::Public {
|
||||||
return; // re-exports are fine
|
return; // re-exports are fine
|
||||||
}
|
}
|
||||||
if let ItemUse(ref path, UseKind::Glob) = item.node {
|
if let ItemUse(ref path, UseKind::Glob) = item.node {
|
||||||
|
@ -840,7 +840,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
|||||||
.iter()
|
.iter()
|
||||||
.any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &implitem.generics));
|
.any(|k| k.matches(first_arg_ty, first_arg, self_ty, is_copy, &implitem.generics));
|
||||||
then {
|
then {
|
||||||
let lint = if item.vis == hir::Visibility::Public {
|
let lint = if item.vis.node == hir::VisibilityKind::Public {
|
||||||
WRONG_PUB_SELF_CONVENTION
|
WRONG_PUB_SELF_CONVENTION
|
||||||
} else {
|
} else {
|
||||||
WRONG_SELF_CONVENTION
|
WRONG_SELF_CONVENTION
|
||||||
|
@ -51,14 +51,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
println!("impl item `{}`", item.ident.name);
|
println!("impl item `{}`", item.ident.name);
|
||||||
match item.vis {
|
match item.vis.node {
|
||||||
hir::Visibility::Public => println!("public"),
|
hir::VisibilityKind::Public => println!("public"),
|
||||||
hir::Visibility::Crate(_) => println!("visible crate wide"),
|
hir::VisibilityKind::Crate(_) => println!("visible crate wide"),
|
||||||
hir::Visibility::Restricted { ref path, .. } => println!(
|
hir::VisibilityKind::Restricted { ref path, .. } => println!(
|
||||||
"visible in module `{}`",
|
"visible in module `{}`",
|
||||||
print::to_string(print::NO_ANN, |s| s.print_path(path, false))
|
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() {
|
if item.defaultness.is_default() {
|
||||||
println!("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) {
|
fn print_item(cx: &LateContext, item: &hir::Item) {
|
||||||
let did = cx.tcx.hir.local_def_id(item.id);
|
let did = cx.tcx.hir.local_def_id(item.id);
|
||||||
println!("item `{}`", item.name);
|
println!("item `{}`", item.name);
|
||||||
match item.vis {
|
match item.vis.node {
|
||||||
hir::Visibility::Public => println!("public"),
|
hir::VisibilityKind::Public => println!("public"),
|
||||||
hir::Visibility::Crate(_) => println!("visible crate wide"),
|
hir::VisibilityKind::Crate(_) => println!("visible crate wide"),
|
||||||
hir::Visibility::Restricted { ref path, .. } => println!(
|
hir::VisibilityKind::Restricted { ref path, .. } => println!(
|
||||||
"visible in module `{}`",
|
"visible in module `{}`",
|
||||||
print::to_string(print::NO_ANN, |s| s.print_path(path, false))
|
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 {
|
match item.node {
|
||||||
hir::ItemExternCrate(ref _renamed_from) => {
|
hir::ItemExternCrate(ref _renamed_from) => {
|
||||||
|
@ -120,7 +120,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
|
|||||||
if let ItemStatic(ref ty, MutImmutable, body_id) = item.node {
|
if let ItemStatic(ref ty, MutImmutable, body_id) = item.node {
|
||||||
if is_lint_ref_type(ty) {
|
if is_lint_ref_type(ty) {
|
||||||
self.declared_lints.insert(item.name, item.span);
|
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 {
|
let mut collector = LintCollector {
|
||||||
output: &mut self.registered_lints,
|
output: &mut self.registered_lints,
|
||||||
cx,
|
cx,
|
||||||
|
Loading…
Reference in New Issue
Block a user