Add an optional Span to BrAnon and use it to print better error for HRTB error from generator interior
This commit is contained in:
@@ -68,7 +68,7 @@ impl<'tcx> fmt::Debug for ty::adjustment::Adjustment<'tcx> {
|
||||
impl fmt::Debug for ty::BoundRegionKind {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
ty::BrAnon(n) => write!(f, "BrAnon({:?})", n),
|
||||
ty::BrAnon(n, span) => write!(f, "BrAnon({n:?}, {span:?})"),
|
||||
ty::BrNamed(did, name) => {
|
||||
if did.is_crate_root() {
|
||||
write!(f, "BrNamed({})", name)
|
||||
|
||||
Reference in New Issue
Block a user