Skip to content

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

Closed
@lolbinarycat

Description

@lolbinarycat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions