Skip to content

Commit

Permalink
Adjust compiler for HashMap::get_many_mut stabilization
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Jan 27, 2025
1 parent 885278b commit 737e301
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion compiler/rustc_session/src/config/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ impl CheckCfg {
}

if self.exhaustive_values {
#[cfg(not(bootstrap))]
let values = self.expecteds.get_disjoint_mut(VALUES);
#[cfg(bootstrap)]
let values = self.expecteds.get_many_mut(VALUES);

// Get all values map at once otherwise it would be costly.
// (8 values * 220 targets ~= 1760 times, at the time of writing this comment).
let [
Expand All @@ -421,7 +426,7 @@ impl CheckCfg {
Some(values_target_os),
Some(values_target_pointer_width),
Some(values_target_vendor),
] = self.expecteds.get_many_mut(VALUES)
] = values
else {
panic!("unable to get all the check-cfg values buckets");
};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(map_many_mut))]
#![feature(iter_intersperse)]
#![feature(let_chains)]
#![feature(map_many_mut)]
#![feature(rustc_attrs)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end
Expand Down

0 comments on commit 737e301

Please sign in to comment.