File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 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> {
138138 struct EliminateCrateVar < ' b , ' a : ' b > ( & ' b mut Resolver < ' a > , Span ) ;
139139
140140 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+
142158 let ident = path. segments [ 0 ] . ident ;
143159 if ident. name == keywords:: DollarCrate . name ( ) {
144160 path. segments [ 0 ] . ident . name = keywords:: CrateRoot . name ( ) ;
@@ -150,10 +166,13 @@ impl<'a> base::Resolver for Resolver<'a> {
150166 ast:: Ident :: with_empty_ctxt ( name) . with_span_pos ( span)
151167 ) ,
152168 _ => unreachable ! ( ) ,
153- } )
169+ } ) ;
170+ if let Some ( qself) = & mut qself {
171+ qself. position += 1 ;
172+ }
154173 }
155174 }
156- path
175+ ( qself , path)
157176 }
158177
159178 fn fold_mac ( & mut self , mac : ast:: Mac ) -> ast:: Mac {
You can’t perform that action at this time.
0 commit comments