Skip to content

Commit

Permalink
Remove another use of BrAnon(Some(_)).
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Apr 14, 2023
1 parent 7dbd2e2 commit f07c335
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_hir_typeck/src/generator_interior/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,14 @@ pub fn resolve_interior<'a, 'tcx>(
_ => mk_bound_region(ty::BrAnon(None)),
}
}
// FIXME: these should use `BrNamed`
ty::ReEarlyBound(region) => {
mk_bound_region(ty::BrNamed(region.def_id, region.name))
}
ty::ReLateBound(_, ty::BoundRegion { kind, .. })
| ty::ReFree(ty::FreeRegion { bound_region: kind, .. }) => match kind {
ty::BoundRegionKind::BrAnon(span) => mk_bound_region(ty::BrAnon(span)),
ty::BoundRegionKind::BrNamed(def_id, _) => {
mk_bound_region(ty::BrAnon(Some(fcx.tcx.def_span(def_id))))
ty::BoundRegionKind::BrNamed(def_id, sym) => {
mk_bound_region(ty::BrNamed(def_id, sym))
}
ty::BoundRegionKind::BrEnv => mk_bound_region(ty::BrAnon(None)),
},
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/generic-associated-types/bugs/issue-100013.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ LL | | async {}.await; // a yield point
LL | | }
| |_____^
|
note: the lifetime defined here...
note: the lifetime `'b` defined here...
--> $DIR/issue-100013.rs:21:14
|
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
| ^^
note: ...must outlive the lifetime defined here
note: ...must outlive the lifetime `'a` defined here
--> $DIR/issue-100013.rs:21:10
|
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
Expand Down

0 comments on commit f07c335

Please sign in to comment.