diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-05-10 20:42:45 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2022-05-10 20:42:45 +0200 |
| commit | e2dc3967fae1afb42614854a600c7e746d891bb7 (patch) | |
| tree | 3e6505070f71c7f712a2bc810352d603e21d3a19 /compiler/rustc_mir_transform/src/coverage/spans.rs | |
| parent | d4c364347ce65cf083d4419195b8232440928d4d (diff) | |
| download | rust-e2dc3967fae1afb42614854a600c7e746d891bb7.tar.gz rust-e2dc3967fae1afb42614854a600c7e746d891bb7.zip | |
simplify length count
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/spans.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coverage/spans.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/spans.rs b/compiler/rustc_mir_transform/src/coverage/spans.rs index 5b7b343949c..512d4daf343 100644 --- a/compiler/rustc_mir_transform/src/coverage/spans.rs +++ b/compiler/rustc_mir_transform/src/coverage/spans.rs @@ -485,7 +485,7 @@ impl<'a, 'tcx> CoverageSpans<'a, 'tcx> { }) { let merged_prefix_len = self.curr_original_span.lo() - self.curr().span.lo(); let after_macro_bang = - merged_prefix_len + BytePos(visible_macro.as_str().bytes().count() as u32 + 1); + merged_prefix_len + BytePos(visible_macro.as_str().len() as u32 + 1); let mut macro_name_cov = self.curr().clone(); self.curr_mut().span = self.curr().span.with_lo(self.curr().span.lo() + after_macro_bang); |
