Skip to content

Commit a1a0669

Browse files
committed
mbe: Move MetaVarExprConcatElem closer to where it is used
Move this structure directly above the `parse_<expr>` functions that return it to keep top-down flow. This is a non-functional change.
1 parent 3d9e510 commit a1a0669

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

compiler/rustc_expand/src/mbe/metavar_expr.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,6 @@ impl MetaVarExpr {
8787
}
8888
}
8989

90-
/// Indicates what is placed in a `concat` parameter. For example, literals
91-
/// (`${concat("foo", "bar")}`) or adhoc identifiers (`${concat(foo, bar)}`).
92-
#[derive(Debug, Decodable, Encodable, PartialEq)]
93-
pub(crate) enum MetaVarExprConcatElem {
94-
/// Identifier WITHOUT a preceding dollar sign, which means that this identifier should be
95-
/// interpreted as a literal.
96-
Ident(Ident),
97-
/// For example, a number or a string.
98-
Literal(Symbol),
99-
/// Identifier WITH a preceding dollar sign, which means that this identifier should be
100-
/// expanded and interpreted as a variable.
101-
Var(Ident),
102-
}
103-
10490
// Checks if there are any remaining tokens. For example, `${ignore(ident ... a b c ...)}`
10591
fn check_trailing_token<'psess>(
10692
iter: &mut TokenStreamIter<'_>,
@@ -117,6 +103,20 @@ fn check_trailing_token<'psess>(
117103
}
118104
}
119105

106+
/// Indicates what is placed in a `concat` parameter. For example, literals
107+
/// (`${concat("foo", "bar")}`) or adhoc identifiers (`${concat(foo, bar)}`).
108+
#[derive(Debug, Decodable, Encodable, PartialEq)]
109+
pub(crate) enum MetaVarExprConcatElem {
110+
/// Identifier WITHOUT a preceding dollar sign, which means that this identifier should be
111+
/// interpreted as a literal.
112+
Ident(Ident),
113+
/// For example, a number or a string.
114+
Literal(Symbol),
115+
/// Identifier WITH a preceding dollar sign, which means that this identifier should be
116+
/// expanded and interpreted as a variable.
117+
Var(Ident),
118+
}
119+
120120
/// Parse a meta-variable `concat` expression: `concat($metavar, ident, ...)`.
121121
fn parse_concat<'psess>(
122122
iter: &mut TokenStreamIter<'_>,

0 commit comments

Comments
 (0)