Repository navigation
Conversation
The diff checks internal MIR before body conversion during transformation, proof metadata generation, and autoharness processing, including instantiation search. It reports each explicit tail call in the body at its source span and aborts with an unsupported-feature diagnostic. It adds a diagnostic regression test and a verification case where the harness never calls the function containing `become`. It also documents explicit tail calls as unsupported. Fixes model-checking#5131
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Verifying code that uses an explicit tail call (
become) can crash the compiler with a “not implemented” panic instead of reporting an unsupported feature.rustc_publichas noTailCallterminator variant, so converting a body containing one reachesunimplemented!(). Kani loaded these bodies without checking for explicit tail calls first.What changed
The diff checks internal MIR before body conversion during transformation, proof metadata generation, and autoharness processing, including instantiation search. It reports each explicit tail call in the body at its source span and aborts with an unsupported-feature diagnostic. It adds a diagnostic regression test and a verification case where the harness never calls the function containing
become. It also documents explicit tail calls as unsupported.Testing
Ran
cargo testlocally for the kani resolve_deferred_fn_slots change; it passed.repo_lintwas run with no output shown; the transcript does not record its exit status../scripts/ci/run-copyright-check.shwas run with no output shown; the transcript does not record its exit status../scripts/run-clang-format.sh -dwas run with no output shown; the transcript does not record its exit status../scripts/run-autopep8.shwas run with no output shown; the transcript does not record its exit status.(cargo clippy --all --message-format=json 2>/dev/null | jq 'select(.message!=null) | .message.code.code' | grep -v '^null$' | sort | uniq -c) || trueproduced no recorded output, but the pipeline does not establish that Clippy passed. The tests intests/kani/TailCall/unreachable.rs,tests/ui/explicit-tail-calls/expectedandtests/ui/explicit-tail-calls/main.rsfail without the fix in the kani resolve_deferred_fn_slots change (checked by reverting the source changes). Regression check for the kani resolve_deferred_fn_slots change: 1 fails on main, 1 passes with the fix; hosted CI not run.The new test tests/kani/TailCall/unreachable.rs did not run here: no test runner for it was available. The new test tests/ui/explicit-tail-calls/main.rs did not run here: no test runner for it was available.
Fixes #5131
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
AI was used for assistance.