Skip to content

#13354 diagnose some incorrect usages of the question mark operator creates incorrect error #13429

Closed
@DaughterOfMars

Description

@DaughterOfMars

The changes made by #13354 cause the following incorrect error in this minimal example using axum:

use axum::{routing::get, Router, Server};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    Server::bind(&([0, 0, 0, 0], 8080).into())
        .serve(
            Router::new()
                .route("test", get(|| async { "hello" }))
                .into_make_service(),
        )
        .await?;

    Ok(())
}
the trait `Try` is not implemented for `_`rust-analyzer[not-implemented](https://rust-analyzer.github.io/manual.html#not-implemented)

rust-analyzer version: 0.3.1248-standalone (0531aab52 2022-10-16)

rustc version: rustc 1.66.0-nightly (a37499ae6 2022-09-18)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions