@@ -63,7 +63,7 @@ use std::{rc::Rc, sync::Arc};
6363
6464use intern:: { Symbol , sym} ;
6565use smallvec:: { SmallVec , smallvec} ;
66- use span:: { Edition , Span } ;
66+ use span:: Span ;
6767use tt:: {
6868 DelimSpan ,
6969 iter:: { TtElement , TtIter } ,
@@ -112,11 +112,11 @@ impl Match<'_> {
112112
113113/// Matching errors are added to the `Match`.
114114pub ( super ) fn match_ < ' t > (
115+ db : & dyn salsa:: Database ,
115116 pattern : & ' t MetaTemplate ,
116117 input : & ' t tt:: TopSubtree < Span > ,
117- edition : Edition ,
118118) -> Match < ' t > {
119- let mut res = match_loop ( pattern , input , edition ) ;
119+ let mut res = match_loop ( db , pattern , input ) ;
120120 res. bound_count = count ( res. bindings . bindings ( ) ) ;
121121 return res;
122122
@@ -365,6 +365,7 @@ struct MatchState<'t> {
365365/// - `error_items`: the set of items in errors, used for error-resilient parsing
366366#[ inline]
367367fn match_loop_inner < ' t > (
368+ db : & dyn salsa:: Database ,
368369 src : TtIter < ' t , Span > ,
369370 stack : & [ TtIter < ' t , Span > ] ,
370371 res : & mut Match < ' t > ,
@@ -375,7 +376,6 @@ fn match_loop_inner<'t>(
375376 eof_items : & mut SmallVec < [ MatchState < ' t > ; 1 ] > ,
376377 error_items : & mut SmallVec < [ MatchState < ' t > ; 1 ] > ,
377378 delim_span : tt:: DelimSpan < Span > ,
378- edition : Edition ,
379379) {
380380 macro_rules! try_push {
381381 ( $items: expr, $it: expr) => {
@@ -486,7 +486,7 @@ fn match_loop_inner<'t>(
486486 OpDelimited :: Op ( Op :: Var { kind, name, .. } ) => {
487487 if let & Some ( kind) = kind {
488488 let mut fork = src. clone ( ) ;
489- let match_res = match_meta_var ( kind, & mut fork, delim_span, edition ) ;
489+ let match_res = match_meta_var ( db , kind, & mut fork, delim_span) ;
490490 match match_res. err {
491491 None => {
492492 // Some meta variables are optional (e.g. vis)
@@ -621,9 +621,9 @@ fn match_loop_inner<'t>(
621621}
622622
623623fn match_loop < ' t > (
624+ db : & dyn salsa:: Database ,
624625 pattern : & ' t MetaTemplate ,
625626 src : & ' t tt:: TopSubtree < Span > ,
626- edition : Edition ,
627627) -> Match < ' t > {
628628 let span = src. top_subtree ( ) . delimiter . delim_span ( ) ;
629629 let mut src = src. iter ( ) ;
@@ -655,6 +655,7 @@ fn match_loop<'t>(
655655 stdx:: always!( next_items. is_empty( ) ) ;
656656
657657 match_loop_inner (
658+ db,
658659 src. clone ( ) ,
659660 & stack,
660661 & mut res,
@@ -665,7 +666,6 @@ fn match_loop<'t>(
665666 & mut eof_items,
666667 & mut error_items,
667668 span,
668- edition,
669669 ) ;
670670 stdx:: always!( cur_items. is_empty( ) ) ;
671671
@@ -772,14 +772,14 @@ fn match_loop<'t>(
772772}
773773
774774fn match_meta_var < ' t > (
775+ db : & dyn salsa:: Database ,
775776 kind : MetaVarKind ,
776777 input : & mut TtIter < ' t , Span > ,
777778 delim_span : DelimSpan < Span > ,
778- edition : Edition ,
779779) -> ExpandResult < Fragment < ' t > > {
780780 let fragment = match kind {
781781 MetaVarKind :: Path => {
782- return expect_fragment ( input, parser:: PrefixEntryPoint :: Path , edition , delim_span)
782+ return expect_fragment ( db , input, parser:: PrefixEntryPoint :: Path , delim_span)
783783 . map ( Fragment :: Path ) ;
784784 }
785785 MetaVarKind :: Expr ( expr) => {
@@ -807,7 +807,7 @@ fn match_meta_var<'t>(
807807 }
808808 _ => { }
809809 } ;
810- return expect_fragment ( input, parser:: PrefixEntryPoint :: Expr , edition , delim_span)
810+ return expect_fragment ( db , input, parser:: PrefixEntryPoint :: Expr , delim_span)
811811 . map ( Fragment :: Expr ) ;
812812 }
813813 MetaVarKind :: Ident | MetaVarKind :: Tt | MetaVarKind :: Lifetime | MetaVarKind :: Literal => {
@@ -853,7 +853,7 @@ fn match_meta_var<'t>(
853853 MetaVarKind :: Item => parser:: PrefixEntryPoint :: Item ,
854854 MetaVarKind :: Vis => parser:: PrefixEntryPoint :: Vis ,
855855 } ;
856- expect_fragment ( input , fragment , edition , delim_span) . map ( Fragment :: Tokens )
856+ expect_fragment ( db , input , fragment , delim_span) . map ( Fragment :: Tokens )
857857}
858858
859859fn collect_vars ( collector_fun : & mut impl FnMut ( Symbol ) , pattern : & MetaTemplate ) {
0 commit comments