about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/mbe/macro_parser.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-04-08 14:25:37 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-04-11 09:38:40 +1000
commitedd7f2cdab424ff8ed64a84f784a5c1273bcb138 (patch)
treedaa9ad9b04681959149c9bddac2752df2b93dce2 /compiler/rustc_expand/src/mbe/macro_parser.rs
parent4ba609601f1a99ddf3cf0cf70f57c4a045f0f23f (diff)
downloadrust-edd7f2cdab424ff8ed64a84f784a5c1273bcb138.tar.gz
rust-edd7f2cdab424ff8ed64a84f784a5c1273bcb138.zip
Add a useful comment.
Diffstat (limited to 'compiler/rustc_expand/src/mbe/macro_parser.rs')
-rw-r--r--compiler/rustc_expand/src/mbe/macro_parser.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_expand/src/mbe/macro_parser.rs b/compiler/rustc_expand/src/mbe/macro_parser.rs
index d26f80e82fc..b5f56d7d6dc 100644
--- a/compiler/rustc_expand/src/mbe/macro_parser.rs
+++ b/compiler/rustc_expand/src/mbe/macro_parser.rs
@@ -211,6 +211,10 @@ struct MatcherPos {
     /// with one element per metavar decl in the matcher. Each element records token trees matched
     /// against the relevant metavar by the black box parser. An element will be a `MatchedSeq` if
     /// the corresponding metavar decl is within a sequence.
+    ///
+    /// It is critical to performance that this is an `Lrc`, because it gets cloned frequently when
+    /// processing sequences. Mostly for sequence-ending possibilities that must be tried but end
+    /// up failing.
     matches: Lrc<Vec<NamedMatch>>,
 }