Add var to BoundRegion. Add query to get bound vars for applicable items.
This commit is contained in:
@@ -810,7 +810,7 @@ impl CanonicalUserType<'tcx> {
|
||||
ty::ReLateBound(debruijn, br) => {
|
||||
// We only allow a `ty::INNERMOST` index in substitutions.
|
||||
assert_eq!(*debruijn, ty::INNERMOST);
|
||||
cvar == br.assert_bound_var()
|
||||
cvar == br.var
|
||||
}
|
||||
_ => false,
|
||||
},
|
||||
@@ -2672,6 +2672,17 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
pub fn object_lifetime_defaults(self, id: HirId) -> Option<Vec<ObjectLifetimeDefault>> {
|
||||
self.object_lifetime_defaults_map(id.owner)
|
||||
}
|
||||
|
||||
pub fn late_bound_vars(self, id: HirId) -> &'tcx List<ty::BoundVariableKind> {
|
||||
self.mk_bound_variable_kinds(
|
||||
self.late_bound_vars_map(id.owner)
|
||||
.and_then(|map| map.get(&id.local_id).cloned())
|
||||
.unwrap_or_else(|| {
|
||||
bug!("No bound vars found for {:?} ({:?})", self.hir().node_to_string(id), id)
|
||||
})
|
||||
.iter(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl TyCtxtAt<'tcx> {
|
||||
|
||||
Reference in New Issue
Block a user