-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Unreachable statement is not checked for const assertions #111202
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
Comments
While this is not high impact problem for working code, since it never progresses past the The fact that the location of the |
doctests, that is. |
It is somewhat intended. Avoiding looking into dead code is done on purpose, so that That said, this all is done rather opportunistically and there is some desire to change something in this space that may then also affect what we do in dead code. |
I understand. It is a rather unfortunate cross section of not wanting to instantiate a complete system in a doctest to get a valid Putting the |
Thinking about this I feel like |
I tried this code:
I expected to see this happen: I expected the second line in
main
to cause a compilation failure. But due to thetodo
this does not happen.Instead, this happened: It compiles, but warns about unused code.
Meta
rustc --version --verbose
:this also happens on nightly
1.71.0-nightly (2023-05-03 473f916d836cc662c5bd)
Playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c3caf7f91c27f00067173e0e83406a24
Found together with @matthiasbeyer
The text was updated successfully, but these errors were encountered: