@@ -11,7 +11,7 @@ use syntax::{
11
11
} ;
12
12
use tt:: {
13
13
buffer:: { Cursor , TokenBuffer } ,
14
- Span , SyntaxContext ,
14
+ Span ,
15
15
} ;
16
16
17
17
use crate :: { to_parser_input:: to_parser_input, tt_iter:: TtIter } ;
@@ -37,7 +37,6 @@ impl<S: Span, SM: SpanMapper<S>> SpanMapper<S> for &SM {
37
37
38
38
/// Dummy things for testing where spans don't matter.
39
39
pub ( crate ) mod dummy_test_span_utils {
40
- use tt:: SyntaxContext ;
41
40
42
41
use super :: * ;
43
42
@@ -53,9 +52,6 @@ pub(crate) mod dummy_test_span_utils {
53
52
54
53
#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
55
54
pub struct DummyTestSyntaxContext ;
56
- impl SyntaxContext for DummyTestSyntaxContext {
57
- const DUMMY : Self = DummyTestSyntaxContext ;
58
- }
59
55
60
56
pub struct DummyTestSpanMap ;
61
57
@@ -82,7 +78,7 @@ pub fn syntax_node_to_token_tree<Ctx, SpanMap>(
82
78
) -> tt:: Subtree < SpanData < Ctx > >
83
79
where
84
80
SpanData < Ctx > : Span ,
85
- Ctx : SyntaxContext ,
81
+ Ctx : Copy ,
86
82
SpanMap : SpanMapper < SpanData < Ctx > > ,
87
83
{
88
84
let mut c = Converter :: new ( node, map, Default :: default ( ) , Default :: default ( ) , span) ;
@@ -102,7 +98,7 @@ pub fn syntax_node_to_token_tree_modified<Ctx, SpanMap>(
102
98
where
103
99
SpanMap : SpanMapper < SpanData < Ctx > > ,
104
100
SpanData < Ctx > : Span ,
105
- Ctx : SyntaxContext ,
101
+ Ctx : Copy ,
106
102
{
107
103
let mut c = Converter :: new ( node, map, append, remove, call_site) ;
108
104
convert_tokens ( & mut c)
@@ -128,7 +124,7 @@ pub fn token_tree_to_syntax_node<Ctx>(
128
124
) -> ( Parse < SyntaxNode > , SpanMap < SpanData < Ctx > > )
129
125
where
130
126
SpanData < Ctx > : Span ,
131
- Ctx : SyntaxContext ,
127
+ Ctx : Copy ,
132
128
{
133
129
let buffer = match tt {
134
130
tt:: Subtree {
@@ -165,7 +161,7 @@ pub fn parse_to_token_tree<Ctx>(
165
161
) -> Option < tt:: Subtree < SpanData < Ctx > > >
166
162
where
167
163
SpanData < Ctx > : Span ,
168
- Ctx : SyntaxContext ,
164
+ Ctx : Copy ,
169
165
{
170
166
let lexed = parser:: LexedStr :: new ( text) ;
171
167
if lexed. errors ( ) . next ( ) . is_some ( ) {
@@ -531,7 +527,7 @@ impl<S: Span> SrcToken<StaticRawConverter<'_, S>, S> for usize {
531
527
}
532
528
}
533
529
534
- impl < Ctx : SyntaxContext > TokenConverter < SpanData < Ctx > > for RawConverter < ' _ , Ctx >
530
+ impl < Ctx : Copy > TokenConverter < SpanData < Ctx > > for RawConverter < ' _ , Ctx >
535
531
where
536
532
SpanData < Ctx > : Span ,
537
533
{
0 commit comments