File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
binding-generator/src/writer/rust_native Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ impl RustNativeGeneratedElement for Func<'_, '_> {
389389 . rust_extern_arg_func_decl ( "instance" ) ,
390390 ) ;
391391 }
392- for ( name, arg) in rust_disambiguate_names ( self . arguments ( ) . into_owned ( ) ) {
392+ for ( name, arg) in rust_disambiguate_names_ref ( self . arguments ( ) . as_ref ( ) ) {
393393 args. push ( arg. type_ref ( ) . render_lane ( ) . to_dyn ( ) . rust_extern_arg_func_decl ( & name) )
394394 }
395395
Original file line number Diff line number Diff line change @@ -302,6 +302,19 @@ where
302302 NamePool :: with_capacity ( size_hint. 1 . unwrap_or ( size_hint. 0 ) ) . into_disambiguator ( args, |f| f. rust_leafname ( FishStyle :: No ) )
303303}
304304
305+ fn rust_disambiguate_names_ref < ' f , ' tu , ' ge > (
306+ args : impl IntoIterator < Item = & ' f Field < ' tu , ' ge > > ,
307+ ) -> impl Iterator < Item = ( String , & ' f Field < ' tu , ' ge > ) >
308+ where
309+ ' tu : ' ge ,
310+ ' tu : ' f ,
311+ ' ge : ' f ,
312+ {
313+ let args = args. into_iter ( ) ;
314+ let size_hint = args. size_hint ( ) ;
315+ NamePool :: with_capacity ( size_hint. 1 . unwrap_or ( size_hint. 0 ) ) . into_disambiguator ( args, |f| f. rust_leafname ( FishStyle :: No ) )
316+ }
317+
305318pub fn disambiguate_single_name ( name : & str ) -> impl Iterator < Item = String > + ' _ {
306319 let mut i = 0 ;
307320 iter:: from_fn ( move || {
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ impl Lifetime {
2727
2828 pub fn is_explicit ( & self ) -> bool {
2929 match self {
30- Lifetime :: Elided => false ,
31- Lifetime :: Custom ( _) | Lifetime :: Automatic ( _) => true ,
30+ Self :: Elided => false ,
31+ Self :: Custom ( _) | Self :: Automatic ( _) => true ,
3232 }
3333 }
3434
@@ -44,7 +44,7 @@ impl Lifetime {
4444}
4545
4646impl IntoIterator for Lifetime {
47- type Item = Lifetime ;
47+ type Item = Self ;
4848 type IntoIter = LifetimeIterator ;
4949
5050 fn into_iter ( self ) -> LifetimeIterator {
You can’t perform that action at this time.
0 commit comments