Add generic arg infer

This commit is contained in:
kadmin
2021-04-24 21:41:57 +00:00
parent 71a6c7c803
commit 417b098cfc
28 changed files with 265 additions and 89 deletions

View File

@@ -436,13 +436,22 @@ pub trait Visitor<'v>: Sized {
fn visit_label(&mut self, label: &'v Label) {
walk_label(self, label)
}
fn visit_infer(&mut self, inf: &'v InferArg) {
self.visit_id(inf.hir_id);
}
fn visit_generic_arg(&mut self, generic_arg: &'v GenericArg<'v>) {
match generic_arg {
GenericArg::Lifetime(lt) => self.visit_lifetime(lt),
GenericArg::Type(ty) => self.visit_ty(ty),
GenericArg::Const(ct) => self.visit_anon_const(&ct.value),
GenericArg::Infer(inf) => self.visit_infer(inf),
}
}
/*
fn tcx(&self) -> Option<&TyCtxt<'tcx>> {
None
}
*/
fn visit_lifetime(&mut self, lifetime: &'v Lifetime) {
walk_lifetime(self, lifetime)
}
@@ -746,6 +755,10 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) {
}
}
pub fn walk_inf<'v, V: Visitor<'v>>(visitor: &mut V, inf: &'v InferArg) {
visitor.visit_id(inf.hir_id);
}
pub fn walk_qpath<'v, V: Visitor<'v>>(
visitor: &mut V,
qpath: &'v QPath<'v>,