Skip to content

Commit 575fe58

Browse files
committed
rustc_ast: Remove one level of indirection from LazyTokenStream
1 parent 4f7612a commit 575fe58

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ pub struct Expr {
10541054

10551055
// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
10561056
#[cfg(target_arch = "x86_64")]
1057-
rustc_data_structures::static_assert_size!(Expr, 112);
1057+
rustc_data_structures::static_assert_size!(Expr, 128);
10581058

10591059
impl Expr {
10601060
/// Returns `true` if this expression would be valid somewhere that expects a value;

compiler/rustc_ast/src/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ pub enum Nonterminal {
698698

699699
// `Nonterminal` is used a lot. Make sure it doesn't unintentionally get bigger.
700700
#[cfg(target_arch = "x86_64")]
701-
rustc_data_structures::static_assert_size!(Nonterminal, 48);
701+
rustc_data_structures::static_assert_size!(Nonterminal, 56);
702702

703703
#[derive(Debug, Copy, Clone, PartialEq, Encodable, Decodable)]
704704
pub enum NonterminalKind {

compiler/rustc_ast/src/tokenstream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ impl CreateTokenStream for TokenStream {
134134
/// of an actual `TokenStream` until it is needed.
135135
/// `Box` is here only to reduce the structure size.
136136
#[derive(Clone)]
137-
pub struct LazyTokenStream(Lrc<Box<dyn CreateTokenStream>>);
137+
pub struct LazyTokenStream(Lrc<dyn CreateTokenStream>);
138138

139139
impl LazyTokenStream {
140140
pub fn new(inner: impl CreateTokenStream + 'static) -> LazyTokenStream {
141-
LazyTokenStream(Lrc::new(Box::new(inner)))
141+
LazyTokenStream(Lrc::new(inner))
142142
}
143143

144144
pub fn create_token_stream(&self) -> TokenStream {

0 commit comments

Comments
 (0)