Skip to content

Commit 9f082d2

Browse files
committed
Auto merge of #39714 - vadimcn:top-level-expn2, r=michaelwoerister
Code cleanup. r? @michaelwoerister Just figured out that the same condition may be expressed much more cleanly. Sorry for the churn!
2 parents 674af8c + 2889675 commit 9f082d2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/librustc_trans/mir/mod.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,14 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
134134
} else {
135135
let cm = self.ccx.sess().codemap();
136136
// Walk up the macro expansion chain until we reach a non-expanded span.
137+
// We also stop at the function body level because no line stepping can occurr
138+
// at the level above that.
137139
let mut span = source_info.span;
138-
while span.expn_id != NO_EXPANSION && span.expn_id != COMMAND_LINE_EXPN {
140+
while span.expn_id != NO_EXPANSION &&
141+
span.expn_id != COMMAND_LINE_EXPN &&
142+
span.expn_id != self.mir.span.expn_id {
139143
if let Some(callsite_span) = cm.with_expn_info(span.expn_id,
140144
|ei| ei.map(|ei| ei.call_site.clone())) {
141-
// When the current function itself is a result of macro expansion,
142-
// we stop at the function body level because no line stepping can occurr
143-
// at the level above that.
144-
if self.mir.span.expn_id != NO_EXPANSION &&
145-
span.expn_id == self.mir.span.expn_id {
146-
break;
147-
}
148145
span = callsite_span;
149146
} else {
150147
break;

0 commit comments

Comments
 (0)