Skip to content

[Regression] type-mismatch on expanded macro #11816

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

Closed
BlackDex opened this issue Mar 25, 2022 · 3 comments
Closed

[Regression] type-mismatch on expanded macro #11816

BlackDex opened this issue Mar 25, 2022 · 3 comments

Comments

@BlackDex
Copy link

rust-analyzer version:
Broken since:

  • v0.3.987 - rust-analyzer version: c2ea378 2022-03-23 nightly

Working in:

rustc version: rustc 1.59.0 (9d1b2106e 2022-02-23)

relevant settings: All default except for features which have sqlite,postgresql,mysql configured.

codebase: https://github.com/dani-garcia/vaultwarden (Branch: main)

Getting the following errors:
utils.rs:
expected Pin<Box<dyn Future<Output = ()> + Send, Global>>, found Pin<Box<impl Future<Output = ()>, Global>>

admin.rs:
expected Pin<Box<dyn Future<Output = Outcome<Referer, (Status, ()), ()>> + Send, Global>>, found Pin<Box<impl Future<Output = Outcome<Referer, (Status, ()), ()>>, Global>>

Original code (admin.rs#L89):

struct Referer(Option<String>);
#[rocket::async_trait]
impl<'r> FromRequest<'r> for Referer {
    type Error = ();

    async fn from_request(request: &'r Request<'_>) -> request::Outcome<Self, Self::Error> {
        Outcome::Success(Referer(request.headers().get_one("Referer").map(str::to_string)))
    }
}

Looking at the expanded code it does seem to be in there:

::core::pin::Pin<
            Box<
                dyn ::core::future::Future<Output = request::Outcome<Self, Self::Error>>
                    + ::core::marker::Send
                    + 'async_trait,
            >,
        >

Maybe linked to: rust-lang/rust#95267 ?

@Veykril
Copy link
Member

Veykril commented Mar 25, 2022

Duplicate of #11815

@Veykril Veykril marked this as a duplicate of #11815 Mar 25, 2022
@Veykril Veykril closed this as completed Mar 25, 2022
@BlackDex
Copy link
Author

Sorry for the noise.

@Veykril
Copy link
Member

Veykril commented Mar 25, 2022

No problem :)

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

No branches or pull requests

2 participants