File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -80,13 +80,6 @@ pub fn expand(input: &mut Item, is_local: bool) {
8080 }
8181 }
8282 Item :: Impl ( input) => {
83- let mut lifetimes = CollectLifetimes :: new ( "'impl" ) ;
84- lifetimes. visit_type_mut ( & mut * input. self_ty ) ;
85- lifetimes. visit_path_mut ( & mut input. trait_ . as_mut ( ) . unwrap ( ) . 1 ) ;
86- let params = & input. generics . params ;
87- let elided = lifetimes. elided ;
88- input. generics . params = parse_quote ! ( #( #elided, ) * #params) ;
89-
9083 let mut associated_type_impl_traits = Set :: new ( ) ;
9184 for inner in & input. items {
9285 if let ImplItem :: Type ( assoc) = inner {
@@ -167,7 +160,7 @@ fn transform_sig(
167160 ReturnType :: Type ( arrow, ret) => ( * arrow, quote ! ( #ret) ) ,
168161 } ;
169162
170- let mut lifetimes = CollectLifetimes :: new ( "'life" ) ;
163+ let mut lifetimes = CollectLifetimes :: new ( ) ;
171164 for arg in sig. inputs . iter_mut ( ) {
172165 match arg {
173166 FnArg :: Receiver ( arg) => lifetimes. visit_receiver_mut ( arg) ,
Original file line number Diff line number Diff line change @@ -9,15 +9,13 @@ use syn::{
99pub struct CollectLifetimes {
1010 pub elided : Vec < Lifetime > ,
1111 pub explicit : Vec < Lifetime > ,
12- pub name : & ' static str ,
1312}
1413
1514impl CollectLifetimes {
16- pub fn new ( name : & ' static str ) -> Self {
15+ pub fn new ( ) -> Self {
1716 CollectLifetimes {
1817 elided : Vec :: new ( ) ,
1918 explicit : Vec :: new ( ) ,
20- name,
2119 }
2220 }
2321
@@ -37,7 +35,7 @@ impl CollectLifetimes {
3735 }
3836
3937 fn next_lifetime ( & mut self , span : Span ) -> Lifetime {
40- let name = format ! ( "{}{}" , self . name , self . elided. len( ) ) ;
38+ let name = format ! ( "'life{}" , self . elided. len( ) ) ;
4139 let life = Lifetime :: new ( & name, span) ;
4240 self . elided . push ( life. clone ( ) ) ;
4341 life
You can’t perform that action at this time.
0 commit comments