Skip to content
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

#![feature(type_alias_impl_trait)] doesn't work in rust analyzer, but compiles fine #12762

Closed
K4rakara opened this issue Jul 14, 2022 · 1 comment

Comments

@K4rakara
Copy link

rust-analyzer version: rust-analyzer 1.64.0-nightly (5342f47 2022-07-09)
rustc version: rustc 1.64.0-nightly (87588a2af 2022-07-13)

The following causes an error in rust-analyzer but not when compiling with cargo:

#![feature(type_alias_impl_trait)]

pub trait Foo {
    type Output: Future<Output = ()>;
    fn foo(&self) -> Self::Output;
}

struct Type;

impl Foo for Type {
    type Output = impl Future<Output = ()>; // Also doesn't work (in rust-analyzer) if you move this type outside of the impl with an alias.
    fn foo(&self) -> Self::Output {
        async { } // Error: type mismatch, expected {unknown}, got impl Future<Output = ()>
    }
}

Apologies if this is a duplicate of #9673, I was unsure if they were related or not.

@K4rakara
Copy link
Author

Aaaaaand it stopped happening

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

1 participant