Skip to content

Calling Option::unwrap() on a None value recorded in Rocket app #11509

Closed
@whatevernot

Description

@whatevernot

Hello - I have a simple Rocket app which is displaying errors on my endpoint declarations. Example:

#[get("/foo/<d>")]
fn get_foo(d: &RawStr) -> String {
    format!("get_foo:::: {}", d)
}

This results in an error (and ugly red text) "called Option::unwrap() on a None valuerust-analyzer[macro-error]".

I am stumped.

rust-analyzer version:

  • 0.2.940

rustc version:

  • rustc 1.61.0-nightly (3b348d932 2022-02-19)

rustup version:

  • stable-x86_64-unknown-linux-gnu unchanged - rustc 1.58.1 (db9d1b20b 2022-01-20)
  • nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.61.0-nightly (3b348d932 2022-02-19)

I've tried various versions of rust-analyzer and they all seem to exhibit this error.

Any help is appreciated - the code works fine by rust-analyzer flags all my endpoints as errors.

Thanks a bunch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions