File tree 3 files changed +17
-4
lines changed
binding-generator/src/writer/rust_native
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<'_, '_> {
389
389
. rust_extern_arg_func_decl ( "instance" ) ,
390
390
) ;
391
391
}
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 ( ) ) {
393
393
args. push ( arg. type_ref ( ) . render_lane ( ) . to_dyn ( ) . rust_extern_arg_func_decl ( & name) )
394
394
}
395
395
Original file line number Diff line number Diff line change @@ -302,6 +302,19 @@ where
302
302
NamePool :: with_capacity ( size_hint. 1 . unwrap_or ( size_hint. 0 ) ) . into_disambiguator ( args, |f| f. rust_leafname ( FishStyle :: No ) )
303
303
}
304
304
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
+
305
318
pub fn disambiguate_single_name ( name : & str ) -> impl Iterator < Item = String > + ' _ {
306
319
let mut i = 0 ;
307
320
iter:: from_fn ( move || {
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ impl Lifetime {
27
27
28
28
pub fn is_explicit ( & self ) -> bool {
29
29
match self {
30
- Lifetime :: Elided => false ,
31
- Lifetime :: Custom ( _) | Lifetime :: Automatic ( _) => true ,
30
+ Self :: Elided => false ,
31
+ Self :: Custom ( _) | Self :: Automatic ( _) => true ,
32
32
}
33
33
}
34
34
@@ -44,7 +44,7 @@ impl Lifetime {
44
44
}
45
45
46
46
impl IntoIterator for Lifetime {
47
- type Item = Lifetime ;
47
+ type Item = Self ;
48
48
type IntoIter = LifetimeIterator ;
49
49
50
50
fn into_iter ( self ) -> LifetimeIterator {
You can’t perform that action at this time.
0 commit comments