about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/spans.rs
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-05-11 13:16:34 +0900
committerGitHub <noreply@github.com>2022-05-11 13:16:34 +0900
commit304c116b408b1d5f394c7218454c4fdd90c69b75 (patch)
treea2e44f3461e082335d51b27b7c06e0e931cadb2d /compiler/rustc_mir_transform/src/coverage/spans.rs
parent17a735b69a3e9c59f7755d43a0e4b26867e72852 (diff)
parente2dc3967fae1afb42614854a600c7e746d891bb7 (diff)
downloadrust-304c116b408b1d5f394c7218454c4fdd90c69b75.tar.gz
rust-304c116b408b1d5f394c7218454c4fdd90c69b75.zip
Rollup merge of #96916 - matthiaskrgr:simpl_count, r=compiler-errors
simplify length count
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/spans.rs')
-rw-r--r--compiler/rustc_mir_transform/src/coverage/spans.rs2
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);