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
cargo build
Compiling example v0.1.0 (...)
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> src/main.rs:54:16
|
54 | fn stream() -> EventStream![] {
| ^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
It compiles just fine when I use #[openapi(skip)] instead of #[openapi]. But do you have any idea how to make the example work with #[openapi]? Any help would be highly appreciated!
The text was updated successfully, but these errors were encountered:
The EventStream is new in Rocket 0.5.0 (I think). And I don't think this has been added yet (or even looked at).
So you are just breaking new ground at the moment. :)
I would have to look into this to know what the problem is (don't have much time at the moment), wrapping up some other projects atm.
But my best guess is that the macro syntax in that line is triggering something in the codegen of the code.
For now I think your best bet is to try and see if you can replace the EventStream![] with something.
But I don't know if this is even possible.
Maybe something along the lines of:
No, did not have the time to look into this at all. I'm open for other people to have a look at this and open a PR. Otherwise it will be a while because I don't have the time for this.
Hi,
First of all thanks for contributing
okapi
to the world!I just tried to use the first EventStream example from the Rocket documentation decorated with
#[openapi]
and ran into the following error:It compiles just fine when I use
#[openapi(skip)]
instead of#[openapi]
. But do you have any idea how to make the example work with#[openapi]
? Any help would be highly appreciated!The text was updated successfully, but these errors were encountered: