@@ -96,12 +96,12 @@ impl CfgExpr {
9696 // FIXME: Parsing from `tt` is only used in a handful of places, reconsider
9797 // if we should switch them to AST.
9898 #[ cfg( feature = "tt" ) ]
99- pub fn parse < S : Copy > ( tt : & tt:: TopSubtree < S > ) -> CfgExpr {
99+ pub fn parse ( tt : & tt:: TopSubtree ) -> CfgExpr {
100100 next_cfg_expr ( & mut tt. iter ( ) ) . unwrap_or ( CfgExpr :: Invalid )
101101 }
102102
103103 #[ cfg( feature = "tt" ) ]
104- pub fn parse_from_iter < S : Copy > ( tt : & mut tt:: iter:: TtIter < ' _ , S > ) -> CfgExpr {
104+ pub fn parse_from_iter ( tt : & mut tt:: iter:: TtIter < ' _ > ) -> CfgExpr {
105105 next_cfg_expr ( tt) . unwrap_or ( CfgExpr :: Invalid )
106106 }
107107
@@ -149,7 +149,15 @@ fn next_cfg_expr_from_ast(
149149 if let Some ( NodeOrToken :: Token ( literal) ) = it. peek ( )
150150 && matches ! ( literal. kind( ) , SyntaxKind :: STRING )
151151 {
152- let literal = tt:: token_to_literal ( literal. text ( ) , ( ) ) . symbol ;
152+ let dummy_span = span:: Span {
153+ range : span:: TextRange :: empty ( span:: TextSize :: new ( 0 ) ) ,
154+ anchor : span:: SpanAnchor {
155+ file_id : span:: EditionedFileId :: from_raw ( 0 ) ,
156+ ast_id : span:: FIXUP_ERASED_FILE_AST_ID_MARKER ,
157+ } ,
158+ ctx : span:: SyntaxContext :: root ( span:: Edition :: Edition2015 ) ,
159+ } ;
160+ let literal = tt:: token_to_literal ( literal. text ( ) , dummy_span) . symbol ;
153161 it. next ( ) ;
154162 CfgAtom :: KeyValue { key : name, value : literal. clone ( ) } . into ( )
155163 } else {
@@ -179,7 +187,7 @@ fn next_cfg_expr_from_ast(
179187}
180188
181189#[ cfg( feature = "tt" ) ]
182- fn next_cfg_expr < S : Copy > ( it : & mut tt:: iter:: TtIter < ' _ , S > ) -> Option < CfgExpr > {
190+ fn next_cfg_expr ( it : & mut tt:: iter:: TtIter < ' _ > ) -> Option < CfgExpr > {
183191 use intern:: sym;
184192 use tt:: iter:: TtElement ;
185193
0 commit comments