bootstrap: Store and use an explicit CheckKind in check::Rustc - #160606
Conversation
These extra layers of indirection are more confusing than helpful.
|
|
This comment has been minimized.
This comment has been minimized.
|
Thanks! The last commit looks good. I'm a bit wondering about 938bf98 though. I spent a lot of time last year ensuring that our usage of the various check/build/etc. steps is correct. It is very easy to pass the wrong thing to steps like That being said, there is only one usage of that function today, and it is close to where ;new` was, so probably it's fine to remove it. I just want to avoid ad-hoc construction of complicated steps (which this one is, because its fields have non-trivial pre-requisites) across bootstrap, and having a dedicated constructor helps with that. |
This has the pleasant side-effect of making `./x fix compiler` actually work, without breaking `./x clippy` (which relied on the hardcoded `Kind::Check`).
|
In this particular case, I found it weird that the only user of the “real” constructor was the step's own I have pushed a proposed change (diff) that makes |
Yeah, the second constructor needs to bypass, because it is essentially "internal" usage of the step. The I still think that the Feel free to r=me after CI passes with/without adding the constructor back. |
|
@bors r=Kobzol |
bootstrap: Store and use an explicit CheckKind in `check::Rustc` rust-lang#160417 tried to fix `./x fix compiler` by making the `check::Rustc` step properly use `builder.kind` instead of hardcoding `Kind::Check`. However, that ended up breaking `./x clippy`, which was relying on that hardcoded `Kind::Check` to really invoke `cargo check`. This PR therefore adds an explicit CheckKind to individual instances of `check::Rustc`, allowing command-line invocations to perform a `cargo check` or `cargo fix` as appropriate, without breaking other callers that were relying on the hardcoded `cargo check`. As a result, `./x fix compiler` now works. r? Kobzol (or bootstrap)
bootstrap: Store and use an explicit CheckKind in `check::Rustc` rust-lang#160417 tried to fix `./x fix compiler` by making the `check::Rustc` step properly use `builder.kind` instead of hardcoding `Kind::Check`. However, that ended up breaking `./x clippy`, which was relying on that hardcoded `Kind::Check` to really invoke `cargo check`. This PR therefore adds an explicit CheckKind to individual instances of `check::Rustc`, allowing command-line invocations to perform a `cargo check` or `cargo fix` as appropriate, without breaking other callers that were relying on the hardcoded `cargo check`. As a result, `./x fix compiler` now works. r? Kobzol (or bootstrap)
bootstrap: Store and use an explicit CheckKind in `check::Rustc` rust-lang#160417 tried to fix `./x fix compiler` by making the `check::Rustc` step properly use `builder.kind` instead of hardcoding `Kind::Check`. However, that ended up breaking `./x clippy`, which was relying on that hardcoded `Kind::Check` to really invoke `cargo check`. This PR therefore adds an explicit CheckKind to individual instances of `check::Rustc`, allowing command-line invocations to perform a `cargo check` or `cargo fix` as appropriate, without breaking other callers that were relying on the hardcoded `cargo check`. As a result, `./x fix compiler` now works. r? Kobzol (or bootstrap)
bootstrap: Store and use an explicit CheckKind in `check::Rustc` rust-lang#160417 tried to fix `./x fix compiler` by making the `check::Rustc` step properly use `builder.kind` instead of hardcoding `Kind::Check`. However, that ended up breaking `./x clippy`, which was relying on that hardcoded `Kind::Check` to really invoke `cargo check`. This PR therefore adds an explicit CheckKind to individual instances of `check::Rustc`, allowing command-line invocations to perform a `cargo check` or `cargo fix` as appropriate, without breaking other callers that were relying on the hardcoded `cargo check`. As a result, `./x fix compiler` now works. r? Kobzol (or bootstrap)
Rollup of 14 pull requests Successful merges: - #150885 (Revive L4Re target) - #159643 (Add support for splatted function pointers) - #160433 (delegation: add support for wrapping of the return value with `From::from`) - #160530 (refactor handling of target features in Session) - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - #160634 (miri subtree update) - #158904 (Fix FutureDropPoll shim for by-move async closures) - #160335 (dlopen offload) - #160445 (codegen: classify localized MSVC linker progress as linker_info) - #160504 (cleanup borrowck, improve c-variadic handling) - #160587 (Add regression test for associated type outlives bound at call site) - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - #160636 (derive(Diagnostic): link to proper docs)
bootstrap: Store and use an explicit CheckKind in `check::Rustc` rust-lang#160417 tried to fix `./x fix compiler` by making the `check::Rustc` step properly use `builder.kind` instead of hardcoding `Kind::Check`. However, that ended up breaking `./x clippy`, which was relying on that hardcoded `Kind::Check` to really invoke `cargo check`. This PR therefore adds an explicit CheckKind to individual instances of `check::Rustc`, allowing command-line invocations to perform a `cargo check` or `cargo fix` as appropriate, without breaking other callers that were relying on the hardcoded `cargo check`. As a result, `./x fix compiler` now works. r? Kobzol (or bootstrap)
…uwer Rollup of 21 pull requests Successful merges: - #159784 (Hint that memchr returns an in-bounds index) - #150885 (Revive L4Re target) - #159643 (Add support for splatted function pointers) - #160433 (delegation: add support for wrapping of the return value with `From::from`) - #160530 (refactor handling of target features in Session) - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - #160634 (miri subtree update) - #157641 (Do not promote extern statics) - #158904 (Fix FutureDropPoll shim for by-move async closures) - #160103 (Add regression test for GAT bound mismatched type error) - #160335 (dlopen offload) - #160445 (codegen: classify localized MSVC linker progress as linker_info) - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing) - #160504 (cleanup borrowck, improve c-variadic handling) - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements) - #160587 (Add regression test for associated type outlives bound at call site) - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - #160636 (derive(Diagnostic): link to proper docs) - #160644 (Clean up some manual debug impls) - #160649 (move naked function ui tests)
bootstrap: Store and use an explicit CheckKind in `check::Rustc` rust-lang#160417 tried to fix `./x fix compiler` by making the `check::Rustc` step properly use `builder.kind` instead of hardcoding `Kind::Check`. However, that ended up breaking `./x clippy`, which was relying on that hardcoded `Kind::Check` to really invoke `cargo check`. This PR therefore adds an explicit CheckKind to individual instances of `check::Rustc`, allowing command-line invocations to perform a `cargo check` or `cargo fix` as appropriate, without breaking other callers that were relying on the hardcoded `cargo check`. As a result, `./x fix compiler` now works. r? Kobzol (or bootstrap)
…uwer Rollup of 20 pull requests Successful merges: - #159784 (Hint that memchr returns an in-bounds index) - #150885 (Revive L4Re target) - #159643 (Add support for splatted function pointers) - #160433 (delegation: add support for wrapping of the return value with `From::from`) - #160530 (refactor handling of target features in Session) - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - #160634 (miri subtree update) - #157641 (Do not promote extern statics) - #158904 (Fix FutureDropPoll shim for by-move async closures) - #160103 (Add regression test for GAT bound mismatched type error) - #160335 (dlopen offload) - #160445 (codegen: classify localized MSVC linker progress as linker_info) - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing) - #160504 (cleanup borrowck, improve c-variadic handling) - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements) - #160587 (Add regression test for associated type outlives bound at call site) - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - #160636 (derive(Diagnostic): link to proper docs) - #160644 (Clean up some manual debug impls)
bootstrap: Store and use an explicit CheckKind in `check::Rustc` rust-lang#160417 tried to fix `./x fix compiler` by making the `check::Rustc` step properly use `builder.kind` instead of hardcoding `Kind::Check`. However, that ended up breaking `./x clippy`, which was relying on that hardcoded `Kind::Check` to really invoke `cargo check`. This PR therefore adds an explicit CheckKind to individual instances of `check::Rustc`, allowing command-line invocations to perform a `cargo check` or `cargo fix` as appropriate, without breaking other callers that were relying on the hardcoded `cargo check`. As a result, `./x fix compiler` now works. r? Kobzol (or bootstrap)
…uwer Rollup of 28 pull requests Successful merges: - #159784 (Hint that memchr returns an in-bounds index) - #160673 (Improve `canonical_param_env_cache`) - #150885 (Revive L4Re target) - #159643 (Add support for splatted function pointers) - #160433 (delegation: add support for wrapping of the return value with `From::from`) - #160530 (refactor handling of target features in Session) - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`) - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items) - #160683 (Add regression test for unknown feaeture name reported with other errors) - #157641 (Do not promote extern statics) - #158904 (Fix FutureDropPoll shim for by-move async closures) - #159816 (added note/help about iterator invalidation when mutating a collection inside a for loop) - #160103 (Add regression test for GAT bound mismatched type error) - #160335 (dlopen offload) - #160445 (codegen: classify localized MSVC linker progress as linker_info) - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing) - #160504 (cleanup borrowck, improve c-variadic handling) - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements) - #160587 (Add regression test for associated type outlives bound at call site) - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.) - #160633 (delegation: fix determining wrong `FnKind` when delegation is inside const arg) - #160636 (derive(Diagnostic): link to proper docs) - #160644 (Clean up some manual debug impls) - #160649 (move naked function ui tests) - #160672 (Improve `MaybeLiveLocals`) - #160693 (Add branch config for perf. unrolling in bors) - #160696 (rustc_codegen_llvm: handle sm_101* features being an alias) - #160706 (renovate: clarify that vulnerability PRs are opened automatically)
Rollup merge of #160606 - Zalathar:check-kind, r=Kobzol bootstrap: Store and use an explicit CheckKind in `check::Rustc` #160417 tried to fix `./x fix compiler` by making the `check::Rustc` step properly use `builder.kind` instead of hardcoding `Kind::Check`. However, that ended up breaking `./x clippy`, which was relying on that hardcoded `Kind::Check` to really invoke `cargo check`. This PR therefore adds an explicit CheckKind to individual instances of `check::Rustc`, allowing command-line invocations to perform a `cargo check` or `cargo fix` as appropriate, without breaking other callers that were relying on the hardcoded `cargo check`. As a result, `./x fix compiler` now works. r? Kobzol (or bootstrap)
#160417 tried to fix
./x fix compilerby making thecheck::Rustcstep properly usebuilder.kindinstead of hardcodingKind::Check.However, that ended up breaking
./x clippy, which was relying on that hardcodedKind::Checkto really invokecargo check.This PR therefore adds an explicit CheckKind to individual instances of
check::Rustc, allowing command-line invocations to perform acargo checkorcargo fixas appropriate, without breaking other callers that were relying on the hardcodedcargo check.As a result,
./x fix compilernow works.r? Kobzol (or bootstrap)