Skip to content
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

./x clippy errors if lint levels are passed as multiple arguments #132867

Closed
lolbinarycat opened this issue Nov 10, 2024 · 0 comments · Fixed by #132873
Closed

./x clippy errors if lint levels are passed as multiple arguments #132867

lolbinarycat opened this issue Nov 10, 2024 · 0 comments · Fixed by #132873
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@lolbinarycat
Copy link
Contributor

simply do ./x clippy -A clippy::all and bootstrap will crash with an error:

thread 'main' panicked at src/core/build_steps/clippy.rs:85:69:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/0125edf41b8ce32db5c2cce0c83e32ad2e4dde17/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/0125edf41b8ce32db5c2cce0c83e32ad2e4dde17/library/core/src/panicking.rs:74:14
   2: core::panicking::panic
             at /rustc/0125edf41b8ce32db5c2cce0c83e32ad2e4dde17/library/core/src/panicking.rs:148:5
   3: core::option::unwrap_failed
             at /rustc/0125edf41b8ce32db5c2cce0c83e32ad2e4dde17/library/core/src/option.rs:2012:5
   4: core::option::Option<T>::unwrap
             at /rustc/0125edf41b8ce32db5c2cce0c83e32ad2e4dde17/library/core/src/option.rs:972:21
   5: bootstrap::core::build_steps::clippy::get_clippy_rules_in_order::{{closure}}
             at ./src/bootstrap/src/core/build_steps/clippy.rs:85:28
   6: <core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::for_each
             at /rustc/0125edf41b8ce32db5c2cce0c83e32ad2e4dde17/library/core/src/slice/iter/macros.rs:254:21
   7: bootstrap::core::build_steps::clippy::get_clippy_rules_in_order
             at ./src/bootstrap/src/core/build_steps/clippy.rs:83:9
   8: bootstrap::core::build_steps::clippy::lint_args
             at ./src/bootstrap/src/core/build_steps/clippy.rs:61:17
   9: <bootstrap::core::build_steps::clippy::Std as bootstrap::core::builder::Step>::run
             at ./src/bootstrap/src/core/build_steps/clippy.rs:141:13
  10: bootstrap::core::builder::Builder::ensure
             at ./src/bootstrap/src/core/builder/mod.rs:1443:23
  11: <bootstrap::core::build_steps::clippy::Std as bootstrap::core::builder::Step>::make_run
             at ./src/bootstrap/src/core/build_steps/clippy.rs:111:9
  12: bootstrap::core::builder::StepDescription::maybe_run
             at ./src/bootstrap/src/core/builder/mod.rs:388:13
  13: bootstrap::core::builder::StepDescription::run
             at ./src/bootstrap/src/core/builder/mod.rs:438:21
  14: bootstrap::core::builder::Builder::run_step_descriptions
             at ./src/bootstrap/src/core/builder/mod.rs:1117:9
  15: bootstrap::core::builder::Builder::execute_cli
             at ./src/bootstrap/src/core/builder/mod.rs:1097:9
  16: bootstrap::Build::build
             at ./src/bootstrap/src/lib.rs:607:17
  17: bootstrap::main
             at ./src/bootstrap/src/bin/main.rs:82:5
  18: core::ops::function::FnOnce::call_once
             at /rustc/0125edf41b8ce32db5c2cce0c83e32ad2e4dde17/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

the code simply assumes noone will ever do that.

@lolbinarycat lolbinarycat added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Nov 10, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 10, 2024
@onur-ozkan onur-ozkan added C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 10, 2024
@bors bors closed this as completed in 7319666 Nov 11, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 11, 2024
Rollup merge of rust-lang#132873 - onur-ozkan:132867, r=jieyouxu

handle separate prefixes in clippy rules

Fixes rust-lang#132867
mati865 pushed a commit to mati865/rust that referenced this issue Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants