Rollup merge of #95251 - GrishaVar:hashes-u16-to-u8, r=dtolnay

Reduce max hash in raw strings from u16 to u8

[Relevant discussion](https://rust-lang.zulipchat.com/#narrow/stream/237824-t-lang.2Fdoc/topic/Max.20raw.20string.20delimiters)
This commit is contained in:
Dylan DPC 2022-03-31 00:26:31 +02:00 committed by GitHub
commit 7af3565083

View file

@ -81,7 +81,7 @@ impl<'tcx> LateLintPass<'tcx> for Regex {
#[allow(clippy::cast_possible_truncation)] // truncation very unlikely here
#[must_use]
fn str_span(base: Span, c: regex_syntax::ast::Span, offset: u16) -> Span {
fn str_span(base: Span, c: regex_syntax::ast::Span, offset: u8) -> Span {
let offset = u32::from(offset);
let end = base.lo() + BytePos(u32::try_from(c.end.offset).expect("offset too large") + offset);
let start = base.lo() + BytePos(u32::try_from(c.start.offset).expect("offset too large") + offset);