-
Notifications
You must be signed in to change notification settings - Fork 13.3k
async
blocks in a const-context error on nightly, but not on stable
#77361
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
cc @ecstatic-morse in case this is related to what you were doing recently |
searched nightlies: from nightly-2020-08-20 to nightly-2020-09-30 bisected with cargo-bisect-rustc v0.5.2Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc 2020-08-20 --end 2020-09-30 --preserve --regress=error --without-cargo That's #76850 |
cc @rust-lang/wg-const-eval This code was allowed erroneously; async-await has not been stabilized in a const-context. I believe we have exceptions to the backwards compatibility rules for cases like this? Actually doing anything with the This also works in a regular const initializer:
|
Hmm, the span in the error shown above seems wrong:
It's pointing at the section from the space before the
@DutchGhost is that how the error appeared to you when you ran into it? |
Temporarily assigning |
Yea this was never intended to get stabilized and since it's only possible in code that doesn't actually do anything, this is unlikely to occur in practice. I don't see a reasonable way to allow this. Note the same effect is possible with |
So should we remove |
I agree that this falls under "accidental stabilization", and is not a regression.
Still works, or used to work? If it still works that arguably is a bug, |
The second. You can try it in the playground. I'm assigning myself to give a better error message in these cases, but this will remain an error going forward. |
async
blocks in a const-context error on nightly, but not on stable
Since the PR improving the error message for cases like this has been merged, this issue can be closed? |
The following code compiles on stable, but not on nightly. I know this is realy bogus code, and I'm not sure it should be rejected:
On nightly, the error message is:
The text was updated successfully, but these errors were encountered: