Skip to content

Commit e3c73c7

Browse files
authored
Rollup merge of #139353 - nnethercote:LateAnon, r=compiler-errors
Fix `Debug` impl for `LateParamRegionKind`. It uses `Br` prefixes which are inappropriate and appear to have been incorrectly copy/pasted from the `Debug` impl for `BoundRegionKind`. r? `@BoxyUwU`
2 parents d61a473 + fadf910 commit e3c73c7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

compiler/rustc_middle/src/ty/structural_impls.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ impl fmt::Debug for ty::LateParamRegion {
8686
impl fmt::Debug for ty::LateParamRegionKind {
8787
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8888
match *self {
89-
ty::LateParamRegionKind::Anon(idx) => write!(f, "BrAnon({idx})"),
89+
ty::LateParamRegionKind::Anon(idx) => write!(f, "LateAnon({idx})"),
9090
ty::LateParamRegionKind::Named(did, name) => {
9191
if did.is_crate_root() {
92-
write!(f, "BrNamed({name})")
92+
write!(f, "LateNamed({name})")
9393
} else {
94-
write!(f, "BrNamed({did:?}, {name})")
94+
write!(f, "LateNamed({did:?}, {name})")
9595
}
9696
}
97-
ty::LateParamRegionKind::ClosureEnv => write!(f, "BrEnv"),
97+
ty::LateParamRegionKind::ClosureEnv => write!(f, "LateEnv"),
9898
}
9999
}
100100
}

tests/ui/nll/ty-outlives/impl-trait-captures.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ error[E0700]: hidden type for `Opaque(DefId(0:11 ~ impl_trait_captures[aeb9]::fo
44
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
55
| -- ------------ opaque type defined here
66
| |
7-
| hidden type `&ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::'_), '_)) T` captures the anonymous lifetime defined here
7+
| hidden type `&ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), LateNamed(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::'_), '_)) T` captures the anonymous lifetime defined here
88
LL | x
99
| ^
1010
|
11-
help: add a `use<...>` bound to explicitly capture `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::'_), '_))`
11+
help: add a `use<...>` bound to explicitly capture `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), LateNamed(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::'_), '_))`
1212
|
13-
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + use<'a, ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::'_), '_)), T> {
14-
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13+
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + use<'a, ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), LateNamed(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::'_), '_)), T> {
14+
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1515

1616
error: aborting due to 1 previous error
1717

0 commit comments

Comments
 (0)