Rollup merge of #96916 - matthiaskrgr:simpl_count, r=compiler-errors

simplify length count
This commit is contained in:
Yuki Okushi 2022-05-11 13:16:34 +09:00 committed by GitHub
commit 304c116b40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);