about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/invalid_from_utf8.rs
AgeCommit message (Collapse)AuthorLines
2025-06-30Introduce `ByteSymbol`.Nicholas Nethercote-2/+2
It's like `Symbol` but for byte strings. The interner is now used for both `Symbol` and `ByteSymbol`. E.g. if you intern `"dog"` and `b"dog"` you'll get a `Symbol` and a `ByteSymbol` with the same index and the characters will only be stored once. The motivation for this is to eliminate the `Arc`s in `ast::LitKind`, to make `ast::LitKind` impl `Copy`, and to avoid the need to arena-allocate `ast::LitKind` in HIR. The latter change reduces peak memory by a non-trivial amount on literal-heavy benchmarks such as `deep-vector` and `tuple-stress`. `Encoder`, `Decoder`, `SpanEncoder`, and `SpanDecoder` all get some changes so that they can handle normal strings and byte strings. This change does slow down compilation of programs that use `include_bytes!` on large files, because the contents of those files are now interned (hashed). This makes `include_bytes!` more similar to `include_str!`, though `include_bytes!` contents still aren't escaped, and hashing is still much cheaper than escaping.
2025-02-16invalid_from_utf8[_unchecked]: also lint inherent methodsPavel Grigorenko-1/+9
2024-04-29Remove `extern crate rustc_session` from `rustc_lint`.Nicholas Nethercote-0/+1
2024-01-23Rename `LintContext::emit_spanned_lint` as `LintContext::emit_span_lint`.Nicholas Nethercote-1/+1
2024-01-19Pack the u128 in LitKind::IntJosh Stone-1/+1
2023-10-13Format all the let chains in compilerMichael Goulet-12/+22
2023-09-27Fix ICE by introducing an expr_or_init variant for outside bodiesUrgau-2/+2
2023-09-21Improve invalid UTF-8 lint by finding the expression initializerUrgau-11/+14
2023-05-27Add invalid_from_utf8 analogous to invalid_from_utf8_uncheckedUrgau-8/+41
2023-05-27Uplift clippy::invalid_utf8_in_unchecked as invalid_from_utf8_uncheckedUrgau-0/+85