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

async-await: mutually recursive functions compile sometimes #64004

Closed
mb64 opened this issue Aug 29, 2019 · 2 comments · Fixed by #64038

Comments

@mb64
Copy link

commented Aug 29, 2019

In the following code:

async fn rec_1() {
    rec_2().await;
}

async fn rec_2() {
    rec_1().await;
}

This gives an error when it is a part of a lib crate. However, as a part of a bin crate, it compiles.

Here's an erroneously compiling playground link and a correctly erroring playground link

@MSleepyPanda

This comment has been minimized.

Copy link

commented Aug 29, 2019

I guess that's because in the binary, it knows that it will be unused. If you were to actually use it, it errors

@cramertj

This comment has been minimized.

Copy link
Member

commented Aug 30, 2019

Tagging as blocking because fixing this is a potential future-compat hazard.

Centril added a commit to Centril/rust that referenced this issue Sep 5, 2019
Rollup merge of rust-lang#64038 - matthewjasper:deny-mutual-impl-trai…
…t-recursion, r=varkor

Check impl trait substs when checking for recursive types

closes rust-lang#64004

@bors bors closed this in 9024032 Sep 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.