Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8Ki

rename `ImplItemKind::TyAlias` to `ImplItemKind::Type`

The naming of this variant seems inconsistent given that this is not really a "type alias", and the associated type variant for `TraitItemKind` is just called `Type`.
This commit is contained in:
Yuki Okushi 2022-10-10 00:09:42 +09:00 committed by GitHub
commit 5ccf727344
3 changed files with 3 additions and 3 deletions

View File

@ -148,7 +148,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingInline {
let desc = match impl_item.kind {
hir::ImplItemKind::Fn(..) => "a method",
hir::ImplItemKind::Const(..) | hir::ImplItemKind::TyAlias(_) => return,
hir::ImplItemKind::Const(..) | hir::ImplItemKind::Type(_) => return,
};
let assoc_item = cx.tcx.associated_item(impl_item.def_id);

View File

@ -374,7 +374,7 @@ impl<'tcx> LateLintPass<'tcx> for Types {
// Methods are covered by check_fn.
// Type aliases are ignored because oftentimes it's impossible to
// make type alias declaration in trait simpler, see #1013
ImplItemKind::Fn(..) | ImplItemKind::TyAlias(..) => (),
ImplItemKind::Fn(..) | ImplItemKind::Type(..) => (),
}
}

View File

@ -220,7 +220,7 @@ fn trait_item_search_pat(item: &TraitItem<'_>) -> (Pat, Pat) {
fn impl_item_search_pat(item: &ImplItem<'_>) -> (Pat, Pat) {
let (start_pat, end_pat) = match &item.kind {
ImplItemKind::Const(..) => (Pat::Str("const"), Pat::Str(";")),
ImplItemKind::TyAlias(..) => (Pat::Str("type"), Pat::Str(";")),
ImplItemKind::Type(..) => (Pat::Str("type"), Pat::Str(";")),
ImplItemKind::Fn(sig, ..) => (fn_header_search_pat(sig.header), Pat::Str("")),
};
if item.vis_span.is_empty() {