diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-03-31 08:21:36 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-03-31 14:39:00 +1100 |
| commit | f68a0449ed4e49705e2ee70be6e5678aa426b206 (patch) | |
| tree | b978668d9df0404b7c8b51391d6920eb70d094cb /compiler/rustc_expand/src/lib.rs | |
| parent | 048bd67d513d23341431da208aa7ec075d6252b2 (diff) | |
| download | rust-f68a0449ed4e49705e2ee70be6e5678aa426b206.tar.gz rust-f68a0449ed4e49705e2ee70be6e5678aa426b206.zip | |
Remove `MatcherPos::stack`.
`parse_tt` needs a way to get from within submatchers make to the enclosing submatchers. Currently it has two distinct mechanisms for this: - `Delimited` submatchers use `MatcherPos::stack` to record stuff about the parent (and further back ancestors). - `Sequence` submatchers use `MatcherPosSequence::parent` to point to the parent matcher position. Having two mechanisms is really confusing, and it took me a long time to understand all this. This commit eliminates `MatcherPos::stack`, and changes `Delimited` submatchers to use the same mechanism as sequence submatchers. That mechanism is also changed a bit: instead of storing the entire parent `MatcherPos`, we now only store the necessary parts from the parent `MatcherPos`. Overall this is a small performance win, with the positives outweighing the negatives, but it's mostly for clarity.
Diffstat (limited to 'compiler/rustc_expand/src/lib.rs')
| -rw-r--r-- | compiler/rustc_expand/src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index 791ba560607..f5a93905b82 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -1,5 +1,6 @@ #![feature(associated_type_bounds)] #![feature(associated_type_defaults)] +#![feature(box_patterns)] #![feature(box_syntax)] #![feature(crate_visibility_modifier)] #![feature(decl_macro)] |
