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

Fix codegen issue for parameters with lifetimes #1839

Closed

Conversation

jakubdabek
Copy link
Contributor

I added one function to tests, but there might actually be other instances of this bug with other examples I haven't found.

Resolves #1834

This commit implements a workaround for an [issue within rustc].
The problem showed itself when using e.g. a `Vec<&str>` argument
in an async route handler (but not `&str`), which resulted in a
"implementation of `FromForm` is not general enough" error.
The workaround itself works by gathering all invocations of
`FromForm`'s methods inside a block without any `.await` points [ref].

[issue within rustc]: rust-lang/rust#69663
[ref]: rust-lang/rust#57478 (comment)
@jakubdabek jakubdabek force-pushed the 1834-codegen-async-fromform branch from b14e8da to edf8983 Compare August 21, 2021 17:57
@SergioBenitez
Copy link
Member

Ridiculous and unfortunate. But okay. Thank you for taking care of this.

@SergioBenitez
Copy link
Member

Merged in 9177b20. Thanks so so much.

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.

Compiler error with Vec<&str> argument: "error: implementation of FromForm is not general enough"
2 participants