X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibrustc%2Flint%2Fmod.rs;h=14c11af6f3863293f4f4e51dee855bad2bf3ef2a;hb=beeaea4a70766f7cc78abdc6b5991f124f349ca5;hp=e52b6e91f68cd5a50f928c0548c0fae642b577c4;hpb=f1473b6c00cc006771758434ea0e6f21ca0c12a2;p=rust.git diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs index e52b6e91f68..14c11af6f38 100644 --- a/src/librustc/lint/mod.rs +++ b/src/librustc/lint/mod.rs @@ -89,7 +89,6 @@ macro_rules! lint_initializer { /// Declare a static item of type `&'static Lint`. #[macro_export] macro_rules! declare_lint { - // FIXME(#14660): deduplicate (pub $name:ident, $level:ident, $desc:expr) => ( pub static $name: &'static ::rustc::lint::Lint = &lint_initializer!($name, $level, $desc); @@ -131,7 +130,7 @@ pub trait LintPass { // FIXME: eliminate the duplication with `Visitor`. But this also // contains a few lint-specific methods with no equivalent in `Visitor`. pub trait LateLintPass: LintPass { - fn check_ident(&mut self, _: &LateContext, _: Span, _: ast::Ident) { } + fn check_name(&mut self, _: &LateContext, _: Span, _: ast::Name) { } fn check_crate(&mut self, _: &LateContext, _: &hir::Crate) { } fn check_mod(&mut self, _: &LateContext, _: &hir::Mod, _: Span, _: ast::NodeId) { } fn check_foreign_item(&mut self, _: &LateContext, _: &hir::ForeignItem) { } @@ -151,20 +150,17 @@ fn check_fn(&mut self, _: &LateContext, fn check_trait_item(&mut self, _: &LateContext, _: &hir::TraitItem) { } fn check_impl_item(&mut self, _: &LateContext, _: &hir::ImplItem) { } fn check_struct_def(&mut self, _: &LateContext, - _: &hir::StructDef, _: ast::Ident, _: &hir::Generics, _: ast::NodeId) { } + _: &hir::VariantData, _: ast::Name, _: &hir::Generics, _: ast::NodeId) { } fn check_struct_def_post(&mut self, _: &LateContext, - _: &hir::StructDef, _: ast::Ident, _: &hir::Generics, _: ast::NodeId) { } + _: &hir::VariantData, _: ast::Name, _: &hir::Generics, _: ast::NodeId) { } fn check_struct_field(&mut self, _: &LateContext, _: &hir::StructField) { } fn check_variant(&mut self, _: &LateContext, _: &hir::Variant, _: &hir::Generics) { } fn check_variant_post(&mut self, _: &LateContext, _: &hir::Variant, _: &hir::Generics) { } - fn check_opt_lifetime_ref(&mut self, _: &LateContext, _: Span, _: &Option) { } - fn check_lifetime_ref(&mut self, _: &LateContext, _: &hir::Lifetime) { } + fn check_lifetime(&mut self, _: &LateContext, _: &hir::Lifetime) { } fn check_lifetime_def(&mut self, _: &LateContext, _: &hir::LifetimeDef) { } fn check_explicit_self(&mut self, _: &LateContext, _: &hir::ExplicitSelf) { } - // Note that you shouldn't implement both check_mac and check_ast_mac, - // because then your lint will be called twice. Prefer check_ast_mac. - fn check_mac(&mut self, _: &LateContext, _: &ast::Mac) { } fn check_path(&mut self, _: &LateContext, _: &hir::Path, _: ast::NodeId) { } + fn check_path_list_item(&mut self, _: &LateContext, _: &hir::PathListItem) { } fn check_attribute(&mut self, _: &LateContext, _: &ast::Attribute) { } /// Called when entering a syntax node that can have lint attributes such @@ -196,21 +192,17 @@ fn check_fn(&mut self, _: &EarlyContext, fn check_trait_item(&mut self, _: &EarlyContext, _: &ast::TraitItem) { } fn check_impl_item(&mut self, _: &EarlyContext, _: &ast::ImplItem) { } fn check_struct_def(&mut self, _: &EarlyContext, - _: &ast::StructDef, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { } + _: &ast::VariantData, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { } fn check_struct_def_post(&mut self, _: &EarlyContext, - _: &ast::StructDef, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { } + _: &ast::VariantData, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { } fn check_struct_field(&mut self, _: &EarlyContext, _: &ast::StructField) { } fn check_variant(&mut self, _: &EarlyContext, _: &ast::Variant, _: &ast::Generics) { } fn check_variant_post(&mut self, _: &EarlyContext, _: &ast::Variant, _: &ast::Generics) { } - fn check_opt_lifetime_ref(&mut self, - _: &EarlyContext, - _: Span, - _: &Option) { } - fn check_lifetime_ref(&mut self, _: &EarlyContext, _: &ast::Lifetime) { } + fn check_lifetime(&mut self, _: &EarlyContext, _: &ast::Lifetime) { } fn check_lifetime_def(&mut self, _: &EarlyContext, _: &ast::LifetimeDef) { } fn check_explicit_self(&mut self, _: &EarlyContext, _: &ast::ExplicitSelf) { } - fn check_mac(&mut self, _: &EarlyContext, _: &ast::Mac) { } fn check_path(&mut self, _: &EarlyContext, _: &ast::Path, _: ast::NodeId) { } + fn check_path_list_item(&mut self, _: &EarlyContext, _: &ast::PathListItem) { } fn check_attribute(&mut self, _: &EarlyContext, _: &ast::Attribute) { } /// Called when entering a syntax node that can have lint attributes such