ImplItemKind::TyAlias => ImplItemKind::Type

This commit is contained in:
Michael Goulet 2022-10-09 07:09:57 +00:00
parent da16cc1da9
commit 8e76d6687e
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 { let desc = match impl_item.kind {
hir::ImplItemKind::Fn(..) => "a method", 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); let assoc_item = cx.tcx.associated_item(impl_item.def_id);

View File

@ -372,7 +372,7 @@ impl<'tcx> LateLintPass<'tcx> for Types {
// Methods are covered by check_fn. // Methods are covered by check_fn.
// Type aliases are ignored because oftentimes it's impossible to // Type aliases are ignored because oftentimes it's impossible to
// make type alias declaration in trait simpler, see #1013 // 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) { fn impl_item_search_pat(item: &ImplItem<'_>) -> (Pat, Pat) {
let (start_pat, end_pat) = match &item.kind { let (start_pat, end_pat) = match &item.kind {
ImplItemKind::Const(..) => (Pat::Str("const"), Pat::Str(";")), 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("")), ImplItemKind::Fn(sig, ..) => (fn_header_search_pat(sig.header), Pat::Str("")),
}; };
if item.vis_span.is_empty() { if item.vis_span.is_empty() {