diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-07-27 13:59:30 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-08-01 08:53:04 +1000 |
| commit | 09f9acea0a611cdd3185e311b8124737ffd30332 (patch) | |
| tree | 402ec4f62ff53ef785fb48efce2eb443c2ccd158 /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs | |
| parent | 3641b0ca300065f22cdb96007f351a228a8bad5f (diff) | |
| download | rust-09f9acea0a611cdd3185e311b8124737ffd30332.tar.gz rust-09f9acea0a611cdd3185e311b8124737ffd30332.zip | |
Shrink `Token`.
From 72 bytes to 12 bytes (on x86-64). There are two parts to this: - Changing various source code offsets from 64-bit to 32-bit. This is not a problem because the rest of rustc also uses 32-bit source code offsets. This means `Token` is no longer `Copy` but this causes no problems. - Removing the `RawStrError` from `LiteralKind`. Raw string literal invalidity is now indicated by a `None` value within `RawStr`/`RawByteStr`, and the new `validate_raw_str` function can be used to re-lex an invalid raw string literal to get the `RawStrError`. There is one very small change in behaviour. Previously, if a raw string literal matched both the `InvalidStarter` and `TooManyHashes` cases, the latter would override the former. This has now changed, because `raw_double_quoted_string` now uses `?` and so returns immediately upon detecting the `InvalidStarter` case. I think this is a slight improvement to report the earlier-detected error, and it explains the change in the `test_too_many_hashes` test. The commit also removes a couple of comments that refer to #77629 and say that the size of these types don't affect performance. These comments are wrong, though the performance effect is small.
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions
