diff options
| author | Vadim Chugunov <vadimcn@gmail.com> | 2017-02-09 18:35:19 -0800 |
|---|---|---|
| committer | Vadim Chugunov <vadimcn@gmail.com> | 2017-02-09 18:35:19 -0800 |
| commit | 28896758eb0c5d8eac33f02e8fb7fe655459cc52 (patch) | |
| tree | aae063018d0d50533eab38ec5c2d6c6588a92183 /src | |
| parent | 24a70eb598a76edb0941f628a87946b40f2a1c83 (diff) | |
| download | rust-28896758eb0c5d8eac33f02e8fb7fe655459cc52.tar.gz rust-28896758eb0c5d8eac33f02e8fb7fe655459cc52.zip | |
Code cleanup.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_trans/mir/mod.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/librustc_trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs index 0cfc2c8d163..9714fc4e4bd 100644 --- a/src/librustc_trans/mir/mod.rs +++ b/src/librustc_trans/mir/mod.rs @@ -134,17 +134,14 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> { } else { let cm = self.ccx.sess().codemap(); // Walk up the macro expansion chain until we reach a non-expanded span. + // We also stop at the function body level because no line stepping can occurr + // at the level above that. let mut span = source_info.span; - while span.expn_id != NO_EXPANSION && span.expn_id != COMMAND_LINE_EXPN { + while span.expn_id != NO_EXPANSION && + span.expn_id != COMMAND_LINE_EXPN && + span.expn_id != self.mir.span.expn_id { if let Some(callsite_span) = cm.with_expn_info(span.expn_id, |ei| ei.map(|ei| ei.call_site.clone())) { - // When the current function itself is a result of macro expansion, - // we stop at the function body level because no line stepping can occurr - // at the level above that. - if self.mir.span.expn_id != NO_EXPANSION && - span.expn_id == self.mir.span.expn_id { - break; - } span = callsite_span; } else { break; |
