Add TestCases::full_build() to force full builds. #294
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.
Currently,
trybuild
usescargo check
for compile-fail tests, and only usescargo-build
if there are pass tests.Some build failures are not detected by
cargo check
, but only bycargo build
. This is arguably a problem ofcargo check
, but it is the current reality and as far as I can tell, unlikely to change soon.People using
trybuild
are now adding an empty pass tests to work around this problem. While this works, it also clutters the output with[should pass]
and[should fail to compile]
.This PR is a very simple addition to the API that allows users to opt-in to using
cargo build
for all tests, without cluttering the output.Since
trybuild
is all about verifying compile failures, being able to verify failed const-evaluated assertions seems like a pretty important use case. And, as noted before (#225 (comment)), the availability ofconst { }
blocks lifted this use case out of the realm of unreliable hacks.