Skip to content

Conversation

@jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Dec 8, 2025

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

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 8, 2025
@jieyouxu
Copy link
Member Author

jieyouxu commented Dec 8, 2025

@rustbot blocked

@bors try jobs=arm-android,x86_64-mingw-1,test-various

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 8, 2025
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Dec 8, 2025
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
@jieyouxu
Copy link
Member Author

jieyouxu commented Dec 8, 2025

Alternative PR title: Either You Have the Value Or You Don't

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();
Copy link
Member Author

@jieyouxu jieyouxu Dec 8, 2025

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...

@rust-bors
Copy link

rust-bors bot commented Dec 8, 2025

☀️ Try build successful (CI)
Build commit: f5b158d (f5b158dfa2899048c98cb27c42ff4a6bb6dfa24e, parent: ba2142a19c1acabe770433418fa395b8a0ef47a4)

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...
@rustbot
Copy link
Collaborator

rustbot commented Dec 8, 2025

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.

@jieyouxu
Copy link
Member Author

jieyouxu commented Dec 8, 2025

Rebased.
@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Dec 8, 2025
@Zalathar
Copy link
Member

Zalathar commented Dec 8, 2025

Cool.

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 8, 2025

📌 Commit 72541e9 has been approved by Zalathar

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 8, 2025
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
@bors bors merged commit 2b0262c into rust-lang:main Dec 9, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 9, 2025
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
@jieyouxu jieyouxu deleted the compiletest-cli branch December 9, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants