diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-12-06 12:02:56 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-12-06 12:02:56 +0000 |
| commit | 78060cb6de9aba3be1dc5c883cf54eb98a084e22 (patch) | |
| tree | d469f96906befc6dcdedbe2e71806dd71ff5f092 /compiler/rustc_parse_format/src/lib.rs | |
| parent | c5351ad4dcd9f3d73241b2acbfc6b4631da845c5 (diff) | |
| download | rust-78060cb6de9aba3be1dc5c883cf54eb98a084e22.tar.gz rust-78060cb6de9aba3be1dc5c883cf54eb98a084e22.zip | |
Box `rustc_parse_format::Piece::NextArgument`
This makes both variants closer together in size (previously they were different by 208 bytes -- 16 vs 224). This may make things worse, but it's worth a try.
Diffstat (limited to 'compiler/rustc_parse_format/src/lib.rs')
| -rw-r--r-- | compiler/rustc_parse_format/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs index 0113eb4e3d1..4d01f706272 100644 --- a/compiler/rustc_parse_format/src/lib.rs +++ b/compiler/rustc_parse_format/src/lib.rs @@ -58,13 +58,13 @@ impl InnerOffset { /// A piece is a portion of the format string which represents the next part /// to emit. These are emitted as a stream by the `Parser` class. -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub enum Piece<'a> { /// A literal string which should directly be emitted String(&'a str), /// This describes that formatting should process the next argument (as /// specified inside) for emission. - NextArgument(Argument<'a>), + NextArgument(Box<Argument<'a>>), } /// Representation of an argument specification. @@ -244,7 +244,7 @@ impl<'a> Iterator for Parser<'a> { } else { self.suggest_positional_arg_instead_of_captured_arg(arg); } - Some(NextArgument(arg)) + Some(NextArgument(Box::new(arg))) } } '}' => { |
