diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-07-02 16:31:24 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-07-02 17:03:53 +1000 |
| commit | 3d750e270279d2d8689aee3ee5cdbf60faec42bd (patch) | |
| tree | bc697c78b063634188791ae529232de869329804 /compiler/rustc_expand/src/mbe/macro_parser.rs | |
| parent | f5b28968db07c96d1e2fe239d380fe5a418e85c5 (diff) | |
| download | rust-3d750e270279d2d8689aee3ee5cdbf60faec42bd.tar.gz rust-3d750e270279d2d8689aee3ee5cdbf60faec42bd.zip | |
Shrink parser positions from `usize` to `u32`.
The number of source code bytes can't exceed a `u32`'s range, so a token position also can't. This reduces the size of `Parser` and `LazyAttrTokenStreamImpl` by eight bytes each.
Diffstat (limited to 'compiler/rustc_expand/src/mbe/macro_parser.rs')
| -rw-r--r-- | compiler/rustc_expand/src/mbe/macro_parser.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_expand/src/mbe/macro_parser.rs b/compiler/rustc_expand/src/mbe/macro_parser.rs index 2fbd09fd9ae..99a9d4f8912 100644 --- a/compiler/rustc_expand/src/mbe/macro_parser.rs +++ b/compiler/rustc_expand/src/mbe/macro_parser.rs @@ -452,7 +452,7 @@ impl TtParser { &mut self, matcher: &'matcher [MatcherLoc], token: &Token, - approx_position: usize, + approx_position: u32, track: &mut T, ) -> Option<NamedParseResult<T::Failure>> { // Matcher positions that would be valid if the macro invocation was over now. Only |
