rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.68k stars 1.5k forks source link

TAIT in `async fn` leads to stack overflow #17199

Open indietyp opened 3 weeks ago

indietyp commented 3 weeks ago

using TAIT (type alias implement trait) in async function leads to a stack overflow. This is not the case for sync functions.

rust-analyzer version: rust-analyzer 1.80.0-nightly (faefc618 2024-05-07)

rustc version: rustc 1.80.0-nightly (faefc618c 2024-05-07)

editor or extension: using zed, but verified in the CLI

relevant settings: N/A

repository link: https://github.com/indietyp/rust-analyzer-regressions/tree/async-tait

code snippet to reproduce:

#![feature(type_alias_impl_trait)]

type Foo = impl std::fmt::Debug;

async fn foo() -> Foo {
    42
}

You can test this yourself using:

$ git clone git@github.com:indietyp/rust-analyzer-regressions.git && cd rust-analyzer-regressions && git switch async-tait
$ rustup run nightly-2024-05-08 rust-analyzer --version
$ rustup run nightly-2024-05-08 rust-analyzer analysis-stats .

the output of the commands has been posted in the README.md of the repository.

Kohei316 commented 2 weeks ago

@rustbot claim