@@ -544,19 +544,19 @@ pub fn noop_fold_arg<T: Folder>(Arg {id, pat, ty}: Arg, fld: &mut T) -> Arg {
544
544
pub fn noop_fold_tt < T : Folder > ( tt : & TokenTree , fld : & mut T ) -> TokenTree {
545
545
match * tt {
546
546
TokenTree :: Token ( span, ref tok) =>
547
- TokenTree :: Token ( span, fld. fold_token ( tok. clone ( ) ) ) ,
547
+ TokenTree :: Token ( fld . new_span ( span) , fld. fold_token ( tok. clone ( ) ) ) ,
548
548
TokenTree :: Delimited ( span, ref delimed) => {
549
- TokenTree :: Delimited ( span, Rc :: new (
549
+ TokenTree :: Delimited ( fld . new_span ( span) , Rc :: new (
550
550
Delimited {
551
551
delim : delimed. delim ,
552
- open_span : delimed. open_span ,
552
+ open_span : fld . new_span ( delimed. open_span ) ,
553
553
tts : fld. fold_tts ( & delimed. tts ) ,
554
- close_span : delimed. close_span ,
554
+ close_span : fld . new_span ( delimed. close_span ) ,
555
555
}
556
556
) )
557
557
} ,
558
558
TokenTree :: Sequence ( span, ref seq) =>
559
- TokenTree :: Sequence ( span,
559
+ TokenTree :: Sequence ( fld . new_span ( span) ,
560
560
Rc :: new ( SequenceRepetition {
561
561
tts : fld. fold_tts ( & seq. tts ) ,
562
562
separator : seq. separator . clone ( ) . map ( |tok| fld. fold_token ( tok) ) ,
@@ -649,7 +649,7 @@ pub fn noop_fold_fn_decl<T: Folder>(decl: P<FnDecl>, fld: &mut T) -> P<FnDecl> {
649
649
inputs : inputs. move_map ( |x| fld. fold_arg ( x) ) ,
650
650
output : match output {
651
651
FunctionRetTy :: Ty ( ty) => FunctionRetTy :: Ty ( fld. fold_ty ( ty) ) ,
652
- FunctionRetTy :: Default ( span) => FunctionRetTy :: Default ( span) ,
652
+ FunctionRetTy :: Default ( span) => FunctionRetTy :: Default ( fld . new_span ( span) ) ,
653
653
} ,
654
654
variadic : variadic
655
655
} )
@@ -676,7 +676,7 @@ pub fn noop_fold_ty_param<T: Folder>(tp: TyParam, fld: &mut T) -> TyParam {
676
676
ident : ident,
677
677
bounds : fld. fold_bounds ( bounds) ,
678
678
default : default. map ( |x| fld. fold_ty ( x) ) ,
679
- span : span
679
+ span : fld . new_span ( span) ,
680
680
}
681
681
}
682
682
0 commit comments