Skip to content

Commit 8bba1b7

Browse files
authored
Rollup merge of rust-lang#72047 - Julian-Wollersberger:literal_error_reporting_cleanup, r=petrochenkov
Literal error reporting cleanup While doing some performance work, I noticed some code duplication in `librustc_parser/lexer/mod.rs`, so I cleaned it up. This PR is probably best reviewed commit by commit. I'm not sure what the API stability practices for `librustc_lexer` are. Four public methods in `unescape.rs` can be removed, but two are used by clippy, so I left them in for now. I could open a PR for Rust-Analyzer when this one lands. But how do I open a PR for clippy? (Git submodules are frustrating to work with)
2 parents b381ea8 + ff9a9ed commit 8bba1b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/write.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ fn check_newlines(fmtstr: &StrLit) -> bool {
483483
};
484484

485485
match fmtstr.style {
486-
StrStyle::Cooked => unescape::unescape_str(contents, &mut cb),
487-
StrStyle::Raw(_) => unescape::unescape_raw_str(contents, &mut cb),
486+
StrStyle::Cooked => unescape::unescape_literal(contents, unescape::Mode::Str, &mut cb),
487+
StrStyle::Raw(_) => unescape::unescape_literal(contents, unescape::Mode::RawStr, &mut cb),
488488
}
489489

490490
should_lint

0 commit comments

Comments
 (0)