Skip to content

Commit

Permalink
Auto merge of rust-lang#118042 - Mark-Simulacrum:beta-next, r=Mark-Si…
Browse files Browse the repository at this point in the history
…mulacrum

[beta] backport & bootstrap bump

Bumps the bootstrap compiler to released 1.74, and lands the first backport:

- rust-lang#117827: coverage: Avoid creating malformed macro name spans

r? `@Mark-Simulacrum`
  • Loading branch information
bors committed Nov 18, 2023
2 parents 782883f + 2e7c61e commit 1bd723f
Show file tree
Hide file tree
Showing 6 changed files with 375 additions and 378 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_mir_transform/src/coverage/spans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ impl<'a> CoverageSpansGenerator<'a> {

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

0 comments on commit 1bd723f

Please sign in to comment.