compiler: Temporarily re-export assert_matches! to reduce stabilization churn#151359
compiler: Temporarily re-export assert_matches! to reduce stabilization churn#151359rust-bors[bot] merged 1 commit intorust-lang:mainfrom
assert_matches! to reduce stabilization churn#151359Conversation
|
Some changes occurred to the CTFE machinery Some changes occurred in match lowering cc @Nadrieril Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to constck cc @fee1-dead HIR ty lowering was modified cc @fmease Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in match checking cc @Nadrieril Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
|
r? @davidtwco rustbot has assigned @davidtwco. Use |
e1801c3 to
e4ce588
Compare
|
Admittedly, making this change (and undoing it later) is its own form of churn. But I think doing things this way is preferable to bundling all of the churn into the stabilization PR. |
This comment has been minimized.
This comment has been minimized.
e4ce588 to
7ec34de
Compare
|
Having like 60 occurances of cfg(bootstrap) in the compiler for this indeed seems undesirable 😅 This will make the bootrstrap bump a lot nicer :) r? me @bors r=BoxyUwU,Noratrieb |
Rollup merge of #151359 - assert-matches, r=BoxyUwU,Noratrieb compiler: Temporarily re-export `assert_matches!` to reduce stabilization churn #137487 proposes to stabilize `feature(assert_matches)`, while simultaneously moving the `assert_matches!` and `debug_assert_matches!` macros out of the `std::assert_matches` submodule and exporting them directly from the `std` crate root instead. Unfortunately, that moving step would cause a lot of `cfg(bootstrap)` churn and noise in the compiler, because the compiler imports and uses those macros in dozens of places. This PR therefore aims to reduce the overall compiler churn, by temporarily adjusting the compiler to always use `assert_matches!` via a re-export from `rustc_data_structures`. That way, the stabilization itself would only need to add `cfg(bootstrap)` to that single re-export (plus the associated `#![feature(assert_matches)]` attributes), greatly reducing the immediate impact on the compiler. Once `assert_matches!` is stable in the stage0 bootstrap compiler, we can go back and delete the re-export, and adjust the rest of the compiler to import directly from `std` instead.
#137487 proposes to stabilize
feature(assert_matches), while simultaneously moving theassert_matches!anddebug_assert_matches!macros out of thestd::assert_matchessubmodule and exporting them directly from thestdcrate root instead.Unfortunately, that moving step would cause a lot of
cfg(bootstrap)churn and noise in the compiler, because the compiler imports and uses those macros in dozens of places.This PR therefore aims to reduce the overall compiler churn, by temporarily adjusting the compiler to always use
assert_matches!via a re-export fromrustc_data_structures. That way, the stabilization itself would only need to addcfg(bootstrap)to that single re-export (plus the associated#![feature(assert_matches)]attributes), greatly reducing the immediate impact on the compiler.Once
assert_matches!is stable in the stage0 bootstrap compiler, we can go back and delete the re-export, and adjust the rest of the compiler to import directly fromstdinstead.