File tree 1 file changed +22
-3
lines changed
1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,23 @@ impl<'a> base::Resolver for Resolver<'a> {
138
138
struct EliminateCrateVar < ' b , ' a : ' b > ( & ' b mut Resolver < ' a > , Span ) ;
139
139
140
140
impl < ' a , ' b > Folder for EliminateCrateVar < ' a , ' b > {
141
- fn fold_path ( & mut self , mut path : ast:: Path ) -> ast:: Path {
141
+ fn fold_path ( & mut self , path : ast:: Path ) -> ast:: Path {
142
+ match self . fold_qpath ( None , path) {
143
+ ( None , path) => path,
144
+ _ => unreachable ! ( ) ,
145
+ }
146
+ }
147
+
148
+ fn fold_qpath ( & mut self , mut qself : Option < ast:: QSelf > , mut path : ast:: Path )
149
+ -> ( Option < ast:: QSelf > , ast:: Path ) {
150
+ qself = qself. map ( |ast:: QSelf { ty, path_span, position } | {
151
+ ast:: QSelf {
152
+ ty : self . fold_ty ( ty) ,
153
+ path_span : self . new_span ( path_span) ,
154
+ position,
155
+ }
156
+ } ) ;
157
+
142
158
let ident = path. segments [ 0 ] . ident ;
143
159
if ident. name == keywords:: DollarCrate . name ( ) {
144
160
path. segments [ 0 ] . ident . name = keywords:: CrateRoot . name ( ) ;
@@ -150,10 +166,13 @@ impl<'a> base::Resolver for Resolver<'a> {
150
166
ast:: Ident :: with_empty_ctxt ( name) . with_span_pos ( span)
151
167
) ,
152
168
_ => unreachable ! ( ) ,
153
- } )
169
+ } ) ;
170
+ if let Some ( qself) = & mut qself {
171
+ qself. position += 1 ;
172
+ }
154
173
}
155
174
}
156
- path
175
+ ( qself , path)
157
176
}
158
177
159
178
fn fold_mac ( & mut self , mac : ast:: Mac ) -> ast:: Mac {
You can’t perform that action at this time.
0 commit comments