fix(script_plugins): the visibility fields of rustc_hir::intravisit::FnKind are gone

<https://github.com/rust-lang/rust/pull/93970>
This commit is contained in:
yvt 2022-10-10 14:14:59 +09:00
parent 75fc8a664f
commit b4c1c972d4

View file

@ -268,7 +268,7 @@ impl<'tcx> LateLintPass<'tcx> for UnrootedPass {
id: HirId, id: HirId,
) { ) {
let in_new_function = match kind { let in_new_function = match kind {
visit::FnKind::ItemFn(n, _, _, _) | visit::FnKind::Method(n, _, _) => { visit::FnKind::ItemFn(n, _, _) | visit::FnKind::Method(n, _) => {
&*n.as_str() == "new" || n.as_str().starts_with("new_") &*n.as_str() == "new" || n.as_str().starts_with("new_")
}, },
visit::FnKind::Closure => return, visit::FnKind::Closure => return,