1
Fork 0

Do not introduce bindings for types and consts in HRTB.

This commit is contained in:
Camille GILLOT 2022-06-09 21:30:18 +02:00
parent 7fe2c4b00d
commit 4d871a25bf
3 changed files with 27 additions and 1 deletions

View file

@ -1981,7 +1981,12 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
continue;
}
};
let res = Res::Def(def_kind, def_id.to_def_id());
let res = match kind {
ItemRibKind(..) | AssocItemRibKind => Res::Def(def_kind, def_id.to_def_id()),
NormalRibKind => Res::Err,
_ => bug!("Unexpected rib kind {:?}", kind),
};
self.r.record_partial_res(param.id, PartialRes::new(res));
rib.bindings.insert(ident, res);
}