Retire opt_str2 from compiletest cli parsing#149754
Merged
bors merged 3 commits intorust-lang:mainfrom Dec 9, 2025
Merged
Conversation
Member
Author
This comment has been minimized.
This comment has been minimized.
rust-bors bot
added a commit
that referenced
this pull request
Dec 8, 2025
Retire `opt_str2` from compiletest cli parsing try-job: arm-android try-job: x86_64-mingw-1 try-job: test-various
Member
Author
|
Alternative PR title: Either You Have the Value Or You Don't |
jieyouxu
commented
Dec 8, 2025
6560409 to
15c497b
Compare
jieyouxu
commented
Dec 8, 2025
| let adb_path = matches.opt_str("adb-path").map(Utf8PathBuf::from).unwrap_or_default(); | ||
| // FIXME: `adb_test_dir` should be an `Option<Utf8PathBuf>`... | ||
| let adb_test_dir = matches.opt_str("adb-test-dir").map(Utf8PathBuf::from).unwrap_or_default(); | ||
| let adb_device_status = target.contains("android") && !adb_test_dir.as_str().is_empty(); |
Member
Author
There was a problem hiding this comment.
Remark: now that I think about it, this should just give up if the test suite is expecting adb && adb_test_dir but said device isn't available...? I can see the only place using this is in run(), this is some funky logic...
Contributor
Instead of allowing them to be missing and using some placeholder "(none)" value instead.
Instead of possibly falling back to "(none)" when they are not specified.
We either have the value of a flag specified, or we don't. Use `Option<...>` to represent that -- don't invent a new "(none)" sentinel value...
15c497b to
72541e9
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Member
Author
|
Rebased. |
Member
|
Cool. @bors r+ |
Collaborator
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Dec 9, 2025
Retire `opt_str2` from compiletest cli parsing We have `Option<..>`, we don't need to invent "(none)" as option-at-home. - More specifically, when some test suite expect certain values to be present, they should `.expect(..)` the value, and not potentially receive some "(none)" in some cases. r? Zalathar
bors
added a commit
that referenced
this pull request
Dec 9, 2025
Rollup of 12 pull requests Successful merges: - #147572 (std: Use more `unix.rs` code on WASI targets) - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - #149215 (Emit `check-cfg` lints during attribute parsing rather than evaluation) - #149652 (Add release notes for 1.92.0) - #149720 (rustdoc book: mention inner doc attribute) - #149730 (lint: emit proper diagnostic for unsafe binders in improper_ctypes instead of ICE) - #149754 (Retire `opt_str2` from compiletest cli parsing) - #149755 (bootstrap: Use a `CompiletestMode` enum instead of bare strings) - #149763 (Add inline attribute to generated delegation function if needed) - #149772 (test: Add a test for 146133) - #149779 (Fix typo "an" → "and") - #149782 (Remove `[no-mentions]` handler in the triagebot config) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Dec 9, 2025
Rollup of 11 pull requests Successful merges: - #147585 (Suppress the error for private fields with non_exhaustive attribute) - #149215 (Emit `check-cfg` lints during attribute parsing rather than evaluation) - #149652 (Add release notes for 1.92.0) - #149720 (rustdoc book: mention inner doc attribute) - #149730 (lint: emit proper diagnostic for unsafe binders in improper_ctypes instead of ICE) - #149754 (Retire `opt_str2` from compiletest cli parsing) - #149755 (bootstrap: Use a `CompiletestMode` enum instead of bare strings) - #149763 (Add inline attribute to generated delegation function if needed) - #149772 (test: Add a test for 146133) - #149779 (Fix typo "an" → "and") - #149782 (Remove `[no-mentions]` handler in the triagebot config) Failed merges: - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Dec 9, 2025
Rollup merge of #149754 - jieyouxu:compiletest-cli, r=Zalathar Retire `opt_str2` from compiletest cli parsing We have `Option<..>`, we don't need to invent "(none)" as option-at-home. - More specifically, when some test suite expect certain values to be present, they should `.expect(..)` the value, and not potentially receive some "(none)" in some cases. r? Zalathar
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.
We have
Option<..>, we don't need to invent "(none)" as option-at-home..expect(..)the value, and not potentially receive some "(none)" in some cases.r? Zalathar