Auto merge of #83484 - JulianKnodt:infer, r=oli-obk,lcnr
Add hir::GenericArg::Infer In order to extend inference to consts, make an Infer type on hir::GenericArg.
This commit is contained in:
commit
fd853c00e2
44 changed files with 519 additions and 103 deletions
|
@ -336,6 +336,14 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
|||
});
|
||||
}
|
||||
|
||||
fn visit_infer(&mut self, inf: &'hir InferArg) {
|
||||
self.insert(inf.span, inf.hir_id, Node::Infer(inf));
|
||||
|
||||
self.with_parent(inf.hir_id, |this| {
|
||||
intravisit::walk_inf(this, inf);
|
||||
});
|
||||
}
|
||||
|
||||
fn visit_trait_ref(&mut self, tr: &'hir TraitRef<'hir>) {
|
||||
self.insert(tr.path.span, tr.hir_ref_id, Node::TraitRef(tr));
|
||||
|
||||
|
|
|
@ -276,6 +276,7 @@ impl<'hir> Map<'hir> {
|
|||
Node::Stmt(_)
|
||||
| Node::PathSegment(_)
|
||||
| Node::Ty(_)
|
||||
| Node::Infer(_)
|
||||
| Node::TraitRef(_)
|
||||
| Node::Pat(_)
|
||||
| Node::Binding(_)
|
||||
|
@ -871,6 +872,7 @@ impl<'hir> Map<'hir> {
|
|||
node: VisibilityKind::Restricted { ref path, .. },
|
||||
..
|
||||
}) => path.span,
|
||||
Node::Infer(i) => i.span,
|
||||
Node::Visibility(v) => bug!("unexpected Visibility {:?}", v),
|
||||
Node::Local(local) => local.span,
|
||||
Node::MacroDef(macro_def) => macro_def.span,
|
||||
|
@ -1118,6 +1120,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId) -> String {
|
|||
Some(Node::Param(_)) => node_str("param"),
|
||||
Some(Node::Arm(_)) => node_str("arm"),
|
||||
Some(Node::Block(_)) => node_str("block"),
|
||||
Some(Node::Infer(_)) => node_str("infer"),
|
||||
Some(Node::Local(_)) => node_str("local"),
|
||||
Some(Node::Ctor(..)) => format!("ctor {}{}", path_str(), id_str),
|
||||
Some(Node::Lifetime(_)) => node_str("lifetime"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue