Simplify bound var resolution.
This commit is contained in:
@@ -2996,7 +2996,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
|
||||
pub fn named_bound_var(self, id: HirId) -> Option<resolve_bound_vars::ResolvedArg> {
|
||||
debug!(?id, "named_region");
|
||||
self.named_variable_map(id.owner).and_then(|map| map.get(&id.local_id).cloned())
|
||||
self.named_variable_map(id.owner).get(&id.local_id).cloned()
|
||||
}
|
||||
|
||||
pub fn is_late_bound(self, id: HirId) -> bool {
|
||||
@@ -3005,12 +3005,9 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||
|
||||
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))
|
||||
}),
|
||||
&self.late_bound_vars_map(id.owner).get(&id.local_id).cloned().unwrap_or_else(|| {
|
||||
bug!("No bound vars found for {}", self.hir().node_to_string(id))
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user