Skip to content

Commit

Permalink
Remove uses of HybridBitSet.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Sep 25, 2023
1 parent 13c1dcc commit f528b4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_borrowck/src/type_check/liveness/trace.rs
@@ -1,5 +1,5 @@
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
use rustc_index::bit_set::HybridBitSet;
use rustc_index::bit_set::BitSet;
use rustc_index::interval::IntervalSet;
use rustc_infer::infer::canonical::QueryRegionConstraints;
use rustc_middle::mir::{BasicBlock, Body, ConstraintCategory, Local, Location};
Expand Down Expand Up @@ -106,7 +106,7 @@ struct LivenessResults<'me, 'typeck, 'flow, 'tcx> {
cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>,

/// Set of points that define the current local.
defs: HybridBitSet<PointIndex>,
defs: BitSet<PointIndex>,

/// Points where the current variable is "use live" -- meaning
/// that there is a future "full use" that may use its value.
Expand All @@ -129,7 +129,7 @@ impl<'me, 'typeck, 'flow, 'tcx> LivenessResults<'me, 'typeck, 'flow, 'tcx> {
let num_points = cx.elements.num_points();
LivenessResults {
cx,
defs: HybridBitSet::new_empty(num_points),
defs: BitSet::new_empty(num_points),
use_live_at: IntervalSet::new(num_points),
drop_live_at: IntervalSet::new(num_points),
drop_locations: vec![],
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_index/src/bit_set.rs
Expand Up @@ -293,7 +293,7 @@ impl<T: Idx> BitSet<T> {
not_already
}

fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T> {
pub fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T> {
let (start, end) = inclusive_start_end(range, self.domain_size)?;
let (start_word_index, _) = word_index_and_mask(start);
let (end_word_index, end_mask) = word_index_and_mask(end);
Expand Down Expand Up @@ -1278,7 +1278,7 @@ impl<T: Idx> SparseBitSet<T> {
}

impl<T: Idx + Ord> SparseBitSet<T> {
fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T> {
pub fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T> {
let mut last_leq = None;
for e in self.iter() {
if range.contains(e) {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/nrvo.rs
@@ -1,7 +1,7 @@
//! See the docs for [`RenameReturnPlace`].

use rustc_hir::Mutability;
use rustc_index::bit_set::HybridBitSet;
use rustc_index::bit_set::BitSet;
use rustc_middle::mir::visit::{MutVisitor, NonUseContext, PlaceContext, Visitor};
use rustc_middle::mir::{self, BasicBlock, Local, Location};
use rustc_middle::ty::TyCtxt;
Expand Down Expand Up @@ -123,7 +123,7 @@ fn find_local_assigned_to_return_place(
body: &mut mir::Body<'_>,
) -> Option<Local> {
let mut block = start;
let mut seen = HybridBitSet::new_empty(body.basic_blocks.len());
let mut seen = BitSet::new_empty(body.basic_blocks.len());

// Iterate as long as `block` has exactly one predecessor that we have not yet visited.
while seen.insert(block) {
Expand Down

0 comments on commit f528b4c

Please sign in to comment.