Add an optional Span to BrAnon and use it to print better error for HRTB error from generator interior
This commit is contained in:
parent
1e1e5b8d98
commit
00e314d5ed
23 changed files with 251 additions and 63 deletions
|
@ -89,10 +89,13 @@ impl<'a> DescriptionCtx<'a> {
|
|||
};
|
||||
me.span = Some(sp);
|
||||
}
|
||||
ty::BrAnon(idx) => {
|
||||
ty::BrAnon(idx, span) => {
|
||||
me.kind = "anon_num_here";
|
||||
me.num_arg = idx+1;
|
||||
me.span = Some(tcx.def_span(scope));
|
||||
me.span = match span {
|
||||
Some(_) => span,
|
||||
None => Some(tcx.def_span(scope)),
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
me.kind = "defined_here_reg";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue