-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Retire opt_str2 from compiletest cli parsing
#149754
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
Conversation
This comment has been minimized.
This comment has been minimized.
Retire `opt_str2` from compiletest cli parsing try-job: arm-android try-job: x86_64-mingw-1 try-job: test-various
|
Alternative PR title: Either You Have the Value Or You Don't |
6560409 to
15c497b
Compare
| 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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
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
|
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. |
|
Rebased. |
|
Cool. @bors r+ |
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
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
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
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
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