test: relax bad_crate_type
to only match error message prefix
#14990
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.
What does this PR try to resolve?
This PR relaxes the
bad_crate_type
test to have it only match the prefix of the unknown crate type error message emitted by rustc.This is so that the cargo test isn't sensitive to (future) suggestions for known crate types that rustc may emit to help the user.
How should we test and review this PR?
This test should already be run as part of cargo CI. (This is definitely run as part of rust-lang/rust CI, lol.)
Additional information
rust-lang/rust side PR that's trying to add a suffix to the bad crate type error message to list all valid
--crate-type
values: rust-lang/rust#134720.Without relaxing this test, the rust-lang/rust side PR fails with:
rust-lang/rust CI fail message
(Ignore the missing colon after
unknown crate type
)Discussed at https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/Reblessing.20a.20cargo.20test.