@@ -395,20 +395,14 @@ impl Bindgen for FunctionBindgen<'_, '_> {
395395
396396 let dealiased_resource = dealias ( resolve, * resource) ;
397397
398+ let name = self . r#gen . type_path ( dealiased_resource, true ) ;
398399 let result = if is_own {
399- let name = self . r#gen . type_path ( dealiased_resource, true ) ;
400400 format ! ( "{name}::from_handle({op} as u32)" )
401401 } else if self . r#gen . is_exported_resource ( * resource) {
402- let name = resolve. types [ * resource]
403- . name
404- . as_deref ( )
405- . unwrap ( )
406- . to_upper_camel_case ( ) ;
407402 format ! ( "{name}Borrow::lift({op} as u32 as usize)" )
408403 } else {
409404 let tmp = format ! ( "handle{}" , self . tmp( ) ) ;
410405 self . handle_decls . push ( format ! ( "let {tmp};" ) ) ;
411- let name = self . r#gen . type_path ( dealiased_resource, true ) ;
412406 format ! (
413407 "{{\n
414408 {tmp} = {name}::from_handle({op} as u32);
@@ -871,14 +865,14 @@ impl Bindgen for FunctionBindgen<'_, '_> {
871865 self . push_str ( & prev_src) ;
872866 let constructor_type = match & func. kind {
873867 FunctionKind :: Freestanding | FunctionKind :: AsyncFreestanding => {
874- self . push_str ( & format ! ( "T ::{}" , to_rust_ident( func. item_name( ) ) ) ) ;
868+ self . push_str ( & format ! ( "T_ ::{}" , to_rust_ident( func. item_name( ) ) ) ) ;
875869 None
876870 }
877871 FunctionKind :: Method ( _)
878872 | FunctionKind :: Static ( _)
879873 | FunctionKind :: AsyncMethod ( _)
880874 | FunctionKind :: AsyncStatic ( _) => {
881- self . push_str ( & format ! ( "T ::{}" , to_rust_ident( func. item_name( ) ) ) ) ;
875+ self . push_str ( & format ! ( "T_ ::{}" , to_rust_ident( func. item_name( ) ) ) ) ;
882876 None
883877 }
884878 FunctionKind :: Constructor ( ty) => {
@@ -892,10 +886,10 @@ impl Bindgen for FunctionBindgen<'_, '_> {
892886
893887 match return_type {
894888 ConstructorReturnType :: Self_ => {
895- self . push_str ( & format ! ( "{ty}::new(T ::new" ) ) ;
889+ self . push_str ( & format ! ( "{ty}::new(T_ ::new" ) ) ;
896890 }
897891 ConstructorReturnType :: Result { .. } => {
898- self . push_str ( & format ! ( "T ::new" ) ) ;
892+ self . push_str ( & format ! ( "T_ ::new" ) ) ;
899893 }
900894 }
901895
0 commit comments