ast/hir: Rename field-related structures
StructField -> FieldDef ("field definition") Field -> ExprField ("expression field", not "field expression") FieldPat -> PatField ("pattern field", not "field pattern") Also rename visiting and other methods working on them.
This commit is contained in:
parent
195ad4830e
commit
b25d3ba781
57 changed files with 313 additions and 301 deletions
|
@ -651,7 +651,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
|
|||
self.check_missing_docs_attrs(cx, foreign_item.hir_id(), foreign_item.span, article, desc);
|
||||
}
|
||||
|
||||
fn check_struct_field(&mut self, cx: &LateContext<'_>, sf: &hir::StructField<'_>) {
|
||||
fn check_field_def(&mut self, cx: &LateContext<'_>, sf: &hir::FieldDef<'_>) {
|
||||
if !sf.is_positional() {
|
||||
self.check_missing_docs_attrs(cx, sf.hir_id, sf.span, "a", "struct field")
|
||||
}
|
||||
|
@ -1345,7 +1345,7 @@ impl<'tcx> LateLintPass<'tcx> for UnreachablePub {
|
|||
);
|
||||
}
|
||||
|
||||
fn check_struct_field(&mut self, cx: &LateContext<'_>, field: &hir::StructField<'_>) {
|
||||
fn check_field_def(&mut self, cx: &LateContext<'_>, field: &hir::FieldDef<'_>) {
|
||||
self.perform_lint(cx, "field", field.hir_id, &field.vis, field.span, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -163,10 +163,10 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
|
|||
run_early_pass!(self, check_struct_def_post, s);
|
||||
}
|
||||
|
||||
fn visit_struct_field(&mut self, s: &'a ast::StructField) {
|
||||
fn visit_field_def(&mut self, s: &'a ast::FieldDef) {
|
||||
self.with_lint_attrs(s.id, &s.attrs, |cx| {
|
||||
run_early_pass!(cx, check_struct_field, s);
|
||||
ast_visit::walk_struct_field(cx, s);
|
||||
run_early_pass!(cx, check_field_def, s);
|
||||
ast_visit::walk_field_def(cx, s);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -219,10 +219,10 @@ impl<'tcx, T: LateLintPass<'tcx>> hir_visit::Visitor<'tcx> for LateContextAndPas
|
|||
lint_callback!(self, check_struct_def_post, s);
|
||||
}
|
||||
|
||||
fn visit_struct_field(&mut self, s: &'tcx hir::StructField<'tcx>) {
|
||||
fn visit_field_def(&mut self, s: &'tcx hir::FieldDef<'tcx>) {
|
||||
self.with_lint_attrs(s.hir_id, |cx| {
|
||||
lint_callback!(cx, check_struct_field, s);
|
||||
hir_visit::walk_struct_field(cx, s);
|
||||
lint_callback!(cx, check_field_def, s);
|
||||
hir_visit::walk_field_def(cx, s);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -619,9 +619,9 @@ impl<'tcx> intravisit::Visitor<'tcx> for LintLevelMapBuilder<'_, 'tcx> {
|
|||
})
|
||||
}
|
||||
|
||||
fn visit_struct_field(&mut self, s: &'tcx hir::StructField<'tcx>) {
|
||||
fn visit_field_def(&mut self, s: &'tcx hir::FieldDef<'tcx>) {
|
||||
self.with_lint_attrs(s.hir_id, |builder| {
|
||||
intravisit::walk_struct_field(builder, s);
|
||||
intravisit::walk_field_def(builder, s);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ macro_rules! late_lint_methods {
|
|||
fn check_impl_item_post(a: &$hir hir::ImplItem<$hir>);
|
||||
fn check_struct_def(a: &$hir hir::VariantData<$hir>);
|
||||
fn check_struct_def_post(a: &$hir hir::VariantData<$hir>);
|
||||
fn check_struct_field(a: &$hir hir::StructField<$hir>);
|
||||
fn check_field_def(a: &$hir hir::FieldDef<$hir>);
|
||||
fn check_variant(a: &$hir hir::Variant<$hir>);
|
||||
fn check_variant_post(a: &$hir hir::Variant<$hir>);
|
||||
fn check_lifetime(a: &$hir hir::Lifetime);
|
||||
|
@ -193,7 +193,7 @@ macro_rules! early_lint_methods {
|
|||
fn check_impl_item_post(a: &ast::AssocItem);
|
||||
fn check_struct_def(a: &ast::VariantData);
|
||||
fn check_struct_def_post(a: &ast::VariantData);
|
||||
fn check_struct_field(a: &ast::StructField);
|
||||
fn check_field_def(a: &ast::FieldDef);
|
||||
fn check_variant(a: &ast::Variant);
|
||||
fn check_variant_post(a: &ast::Variant);
|
||||
fn check_lifetime(a: &ast::Lifetime);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue