You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use syn::{spanned::Spanned,Attribute,FnArg,Ident,ItemTrait,Lifetime,Pat,PatIdent,ReturnType,Signature,TraitBound,TraitBoundModifier,TraitItem,TraitItemConst,TraitItemMethod,TraitItemType,Type,TypeParamBound,WherePredicate,PatType,Token};
5
+
use syn::punctuated::Punctuated;
9
6
10
7
usecrate::{
11
8
analyze::find_suitable_param_names,
@@ -595,29 +592,46 @@ fn gen_method_item(
595
592
// If this method has a `#[auto_impl(keep_default_for(...))]` attribute for
596
593
// the given proxy type, we don't generate anything for this impl block.
597
594
ifshould_keep_default_for(item, proxy_type){
598
-
if item.default.is_some(){
599
-
returnOk(TokenStream2::new());
595
+
returnif item.default.is_some(){
596
+
Ok(TokenStream2::new())
600
597
}else{
601
598
emit_error!(
602
599
item.sig.span(),
603
600
"the method `{}` has the attribute `keep_default_for` but is not a default \
604
601
method (no body is provided)",
605
602
item.sig.ident,
606
603
);
607
-
returnErr(());
604
+
Err(())
608
605
}
609
606
}
610
607
611
608
// Determine the kind of the method, determined by the self type.
0 commit comments