Skip to content

rocket_okapi macro breaks recent rust-analyzer ("expected Expr") #166

Description

@Youx

When using recent versions of rust, okapi macros break rust-analyzer, with cryptic message "expected Expr".

Rustc compiles properly, so it is only visible when editing code

Simple example that reproduces:

use rocket::get;
use rocket_okapi::openapi;

#[openapi(tag = "Toto")]
#[get("/<x>")]
async fn test(x: u32) {
    println!("x: {x}");
    todo!()
}

fn main() {
    println!("Hello, world!");
}

I'm preparing a fix, I think it would be very nice to release a 0.9.1 with a backport of it 🙏

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions