Skip to content

Commit 1bd723f

Browse files
committed
Auto merge of #118042 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backport & bootstrap bump Bumps the bootstrap compiler to released 1.74, and lands the first backport: - #117827: coverage: Avoid creating malformed macro name spans r? `@Mark-Simulacrum`
2 parents 782883f + 2e7c61e commit 1bd723f

File tree

6 files changed

+375
-378
lines changed

6 files changed

+375
-378
lines changed

compiler/rustc_mir_transform/src/coverage/spans.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,12 @@ impl<'a> CoverageSpansGenerator<'a> {
381381

382382
let merged_prefix_len = self.curr_original_span.lo() - curr.span.lo();
383383
let after_macro_bang = merged_prefix_len + BytePos(visible_macro.as_str().len() as u32 + 1);
384+
if self.curr().span.lo() + after_macro_bang > self.curr().span.hi() {
385+
// Something is wrong with the macro name span;
386+
// return now to avoid emitting malformed mappings.
387+
// FIXME(#117788): Track down why this happens.
388+
return;
389+
}
384390
let mut macro_name_cov = curr.clone();
385391
self.curr_mut().span = curr.span.with_lo(curr.span.lo() + after_macro_bang);
386392
macro_name_cov.span =

0 commit comments

Comments
 (0)