mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Fix issue 91206
This commit is contained in:
parent
862962b90e
commit
718a3b1f2d
@ -447,16 +447,20 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||||||
// check if the RHS is from desugaring
|
// check if the RHS is from desugaring
|
||||||
let opt_assignment_rhs_span =
|
let opt_assignment_rhs_span =
|
||||||
self.body.find_assignments(local).first().map(|&location| {
|
self.body.find_assignments(local).first().map(|&location| {
|
||||||
let stmt = &self.body[location.block].statements
|
if let Some(mir::Statement {
|
||||||
[location.statement_index];
|
source_info: _,
|
||||||
match stmt.kind {
|
kind:
|
||||||
mir::StatementKind::Assign(box (
|
mir::StatementKind::Assign(box (
|
||||||
_,
|
_,
|
||||||
mir::Rvalue::Use(mir::Operand::Copy(place)),
|
mir::Rvalue::Use(mir::Operand::Copy(place)),
|
||||||
)) => {
|
)),
|
||||||
|
}) = self.body[location.block]
|
||||||
|
.statements
|
||||||
|
.get(location.statement_index)
|
||||||
|
{
|
||||||
self.body.local_decls[place.local].source_info.span
|
self.body.local_decls[place.local].source_info.span
|
||||||
}
|
} else {
|
||||||
_ => self.body.source_info(location).span,
|
self.body.source_info(location).span
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
match opt_assignment_rhs_span.and_then(|s| s.desugaring_kind()) {
|
match opt_assignment_rhs_span.and_then(|s| s.desugaring_kind()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user