mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Use boxed slices instead ovecs in decl macros
This commit is contained in:
parent
3fdff0ae4b
commit
90499d4390
3 changed files with 6 additions and 6 deletions
|
@ -104,7 +104,7 @@ impl fmt::Display for ExpandError {
|
|||
/// and `$()*` have special meaning (see `Var` and `Repeat` data structures)
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct DeclarativeMacro {
|
||||
rules: Vec<Rule>,
|
||||
rules: Box<[Rule]>,
|
||||
/// Highest id of the token we have in TokenMap
|
||||
shift: Shift,
|
||||
// This is used for correctly determining the behavior of the pat fragment
|
||||
|
@ -217,7 +217,7 @@ impl DeclarativeMacro {
|
|||
validate(lhs)?;
|
||||
}
|
||||
|
||||
Ok(DeclarativeMacro { rules, shift: Shift::new(tt), is_2021 })
|
||||
Ok(DeclarativeMacro { rules: rules.into_boxed_slice(), shift: Shift::new(tt), is_2021 })
|
||||
}
|
||||
|
||||
/// The new, unstable `macro m {}` flavor.
|
||||
|
@ -250,7 +250,7 @@ impl DeclarativeMacro {
|
|||
validate(lhs)?;
|
||||
}
|
||||
|
||||
Ok(DeclarativeMacro { rules, shift: Shift::new(tt), is_2021 })
|
||||
Ok(DeclarativeMacro { rules: rules.into_boxed_slice(), shift: Shift::new(tt), is_2021 })
|
||||
}
|
||||
|
||||
pub fn expand(&self, tt: &tt::Subtree) -> ExpandResult<tt::Subtree> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue