Auto merge of #80163 - jackh726:binder-refactor-part-3, r=lcnr

Make BoundRegion have a kind of BoungRegionKind

Split from #76814

Also includes making `replace_escaping_bound_vars` only return `T`

Going to r? `@lcnr`
Feel free to reassign
This commit is contained in:
bors 2020-12-20 07:01:00 +00:00
commit b1964e60b7
47 changed files with 183 additions and 181 deletions

View file

@ -431,7 +431,9 @@ impl Clean<Option<Lifetime>> for ty::RegionKind {
fn clean(&self, _cx: &DocContext<'_>) -> Option<Lifetime> {
match *self {
ty::ReStatic => Some(Lifetime::statik()),
ty::ReLateBound(_, ty::BrNamed(_, name)) => Some(Lifetime(name)),
ty::ReLateBound(_, ty::BoundRegion { kind: ty::BrNamed(_, name) }) => {
Some(Lifetime(name))
}
ty::ReEarlyBound(ref data) => Some(Lifetime(data.name)),
ty::ReLateBound(..)

View file

@ -104,7 +104,9 @@ fn external_generic_args(
.iter()
.filter_map(|kind| match kind.unpack() {
GenericArgKind::Lifetime(lt) => match lt {
ty::ReLateBound(_, ty::BrAnon(_)) => Some(GenericArg::Lifetime(Lifetime::elided())),
ty::ReLateBound(_, ty::BoundRegion { kind: ty::BrAnon(_) }) => {
Some(GenericArg::Lifetime(Lifetime::elided()))
}
_ => lt.clean(cx).map(GenericArg::Lifetime),
},
GenericArgKind::Type(_) if skip_self => {