hir: add HirId to main Hir nodes

This commit is contained in:
ljedrz 2019-02-02 15:40:08 +01:00
parent c9a8687951
commit 55ef78e885
24 changed files with 257 additions and 114 deletions

View file

@ -3692,7 +3692,7 @@ fn name_from_pat(p: &hir::Pat) -> String {
match p.node {
PatKind::Wild => "_".to_string(),
PatKind::Binding(_, _, ident, _) => ident.to_string(),
PatKind::Binding(_, _, _, ident, _) => ident.to_string(),
PatKind::TupleStruct(ref p, ..) | PatKind::Path(ref p) => qpath_to_string(p),
PatKind::Struct(ref name, ref fields, etc) => {
format!("{} {{ {}{} }}", qpath_to_string(name),
@ -4071,6 +4071,7 @@ where F: Fn(DefId) -> Def {
segments: hir::HirVec::from_vec(apb.names.iter().map(|s| hir::PathSegment {
ident: ast::Ident::from_str(&s),
id: None,
hir_id: None,
def: None,
args: None,
infer_types: false,

View file

@ -174,6 +174,7 @@ impl<'a, 'tcx, 'rcx> DocContext<'a, 'tcx, 'rcx> {
real_name.unwrap_or(last.ident),
None,
None,
None,
self.generics_to_path_params(generics.clone()),
false,
));
@ -206,6 +207,7 @@ impl<'a, 'tcx, 'rcx> DocContext<'a, 'tcx, 'rcx> {
args.push(hir::GenericArg::Lifetime(hir::Lifetime {
id: ast::DUMMY_NODE_ID,
hir_id: hir::DUMMY_HIR_ID,
span: DUMMY_SP,
name: hir::LifetimeName::Param(name),
}));