Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'async_trait lifetime bound to ImplTrait argument #197

Closed
wants to merge 2 commits into from

Conversation

kawaemon
Copy link

This PR resolves #177.

@@ -275,6 +275,13 @@ fn transform_sig(
}) => {}
FnArg::Receiver(arg) => arg.mutability = None,
FnArg::Typed(arg) => {
if let Type::ImplTrait(TypeImplTrait { ref mut bounds, .. }) = *arg.ty {
use syn::spanned::Spanned;
let span = bounds.span();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which span to use. Is this good choice?

@kawaemon
Copy link
Author

Hi @dtolnay, could you review this PR?

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like your implementation only sees arguments whose type is impl Trait, not something like &impl Trait or Option<impl Trait>.

I put up #201 with a different fix that covers those cases.

Thanks anyway for the PR!

@dtolnay dtolnay closed this Jun 2, 2022
@kawaemon kawaemon deleted the fix/issue-177 branch July 20, 2022 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lifetime issue when using "impl FnMut" as argument type
2 participants