@@ -1528,7 +1528,7 @@ impl Wasmtime {
15281528 move |caller: &{wt}::component::Accessor::<T>, rep| {{
15291529 {wt}::component::__internal::Box::pin(async move {{
15301530 let accessor = &caller.with_data(host_getter);
1531- Host{camel}Concurrent ::drop(accessor, {wt}::component::Resource::new_own(rep)).await
1531+ Host{camel}WithStore ::drop(accessor, {wt}::component::Resource::new_own(rep)).await
15321532 }})
15331533 }},
15341534 )?;"
@@ -2892,6 +2892,7 @@ impl<'a> InterfaceGenerator<'a> {
28922892 ) ;
28932893 ret. with_store_name = Some ( format ! ( "{trait_name}WithStore" ) ) ;
28942894
2895+ let mut extra_with_store_function = false ;
28952896 for extra in extra_functions {
28962897 match extra {
28972898 ExtraTraitMethod :: ResourceDrop { name } => {
@@ -2907,6 +2908,7 @@ impl<'a> InterfaceGenerator<'a> {
29072908 self . src,
29082909 "fn drop<T: 'static>(accessor: &{wt}::component::Accessor<T, Self>, rep: {wt}::component::Resource<{camel}>) -> impl ::core::future::Future<Output = {wt}::Result<()>> + Send where Self: Sized;"
29092910 ) ;
2911+ extra_with_store_function = true ;
29102912 }
29112913 ExtraTraitMethod :: ErrorConvert { .. } => { }
29122914 }
@@ -2920,7 +2922,7 @@ impl<'a> InterfaceGenerator<'a> {
29202922
29212923 // If `*WithStore` is empty, generate a blanket impl for the trait since
29222924 // it's otherwise not necessary to implement it manually.
2923- if partition. with_store . is_empty ( ) {
2925+ if partition. with_store . is_empty ( ) && !extra_with_store_function {
29242926 uwriteln ! ( self . src, "impl<_T: ?Sized> {trait_name}WithStore for _T" ) ;
29252927 uwriteln ! (
29262928 self . src,
@@ -2945,13 +2947,12 @@ impl<'a> InterfaceGenerator<'a> {
29452947 for extra in extra_functions {
29462948 match extra {
29472949 ExtraTraitMethod :: ResourceDrop { name } => {
2948- let camel = name. to_upper_camel_case ( ) ;
2949-
29502950 let flags = self . import_resource_drop_flags ( name) ;
29512951 ret. all_func_flags |= flags;
29522952 if flags. contains ( FunctionFlags :: STORE ) {
29532953 continue ;
29542954 }
2955+ let camel = name. to_upper_camel_case ( ) ;
29552956 uwrite ! (
29562957 self . src,
29572958 "fn drop(&mut self, rep: {wt}::component::Resource<{camel}>) -> "
@@ -3020,6 +3021,9 @@ fn convert_{snake}(&mut self, err: {root}{custom_name}) -> {wt}::Result<{camel}>
30203021 match extra {
30213022 ExtraTraitMethod :: ResourceDrop { name } => {
30223023 let flags = self . import_resource_drop_flags ( name) ;
3024+ if flags. contains ( FunctionFlags :: STORE ) {
3025+ continue ;
3026+ }
30233027 let camel = name. to_upper_camel_case ( ) ;
30243028 let mut await_ = "" ;
30253029 if flags. contains ( FunctionFlags :: ASYNC ) {
0 commit comments