Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6701d90
Remove IdxSet::reset_to_empty
varkor Mar 6, 2018
89d1247
Remove IdxSet::each_bit
varkor Mar 6, 2018
f69a099
Remove IdxSet::elems
varkor Mar 6, 2018
c97c7bf
Add info message for -Wall command
Phlosioneer Mar 6, 2018
1246eef
Fix trailing whitespace
Phlosioneer Mar 6, 2018
f53f2fa
librustc_back: bump ISA level of mipsel targets to mips32r2
jcowgill Mar 8, 2018
fccaf25
librustc_back: enable fpxx on 32-bit hardfloat mips targets
jcowgill Mar 8, 2018
0711a7a
librustc_trans: add fp64 to mips features whitelist
jcowgill Mar 8, 2018
366ee85
Fix blink when main theme is selected
GuillaumeGomez Mar 7, 2018
c802204
big fences to show that ```rust is the same as ```
QuietMisdreavus Mar 12, 2018
da257b8
Add missing examples
GuillaumeGomez Mar 12, 2018
5a073d4
Move librustc_typeck READMEs to rustc guide
mark-i-m Mar 13, 2018
c1337cd
Update -Wall message based on feedback
Phlosioneer Mar 13, 2018
04442af
rustc: Don't invoke `lld` with an `@`-file
alexcrichton Mar 13, 2018
21a9770
Adds a test for #48070
sapphire-arches Mar 13, 2018
52bb99d
Move 48070 test to ui
sapphire-arches Mar 13, 2018
6d534d5
Clarify usage message for --remap-path-prefix.
jsgf Mar 13, 2018
63f654a
fix #48816 don't print help on indirect compiler ICE
alexheretic Mar 13, 2018
2f2e173
Speed up SVH computation by using Fingerprint::combine()
hrvolapeter Feb 23, 2018
4ea78d4
Rollup merge of #48765 - Phlosioneer:10234-wall-help-message, r=estebank
kennytm Mar 14, 2018
c65ee94
Rollup merge of #48831 - GuillaumeGomez:fix-theme-blink, r=QuietMisdr…
kennytm Mar 14, 2018
b5f102c
Rollup merge of #48840 - varkor:idxset-cleanup, r=pnkfelix
kennytm Mar 14, 2018
57f7678
Rollup merge of #48964 - QuietMisdreavus:picket-fence, r=GuillaumeGomez
kennytm Mar 14, 2018
c144fb7
Rollup merge of #48970 - GuillaumeGomez:doc-examples, r=QuietMisdreavus
kennytm Mar 14, 2018
ff80cde
Rollup merge of #48971 - mark-i-m:fix_readmes, r=nikomatsakis
kennytm Mar 14, 2018
088bf64
Rollup merge of #48981 - alexcrichton:lld-no-at-file, r=michaelwoerister
kennytm Mar 14, 2018
4074baf
Rollup merge of #48988 - bobtwinkles:add_48070_test, r=nikomatsakis
kennytm Mar 14, 2018
55e5ba3
Rollup merge of #48991 - jsgf:remap-path-prefix, r=estebank
kennytm Mar 14, 2018
6639b60
Rollup merge of #48966 - retep007:hir-fingerprint-optimization, r=mic…
kennytm Mar 14, 2018
508ffa3
Rollup merge of #48993 - alexheretic:fix-48816, r=michaelwoerister
kennytm Mar 14, 2018
beab2e6
Rollup merge of #48874 - jcowgill:mips-features, r=sanxiyn
kennytm Mar 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove IdxSet::elems
  • Loading branch information
varkor committed Mar 6, 2018
commit f69a0999e742a6fc45fd4b962c30c56d04c2245c
26 changes: 0 additions & 26 deletions src/librustc_data_structures/indexed_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,32 +224,6 @@ impl<T: Idx> IdxSet<T> {
_pd: PhantomData,
}
}

pub fn elems(&self, universe_size: usize) -> Elems<T> {
Elems { i: 0, set: self, universe_size: universe_size }
}
}

pub struct Elems<'a, T: Idx> { i: usize, set: &'a IdxSet<T>, universe_size: usize }

impl<'a, T: Idx> Iterator for Elems<'a, T> {
type Item = T;
fn next(&mut self) -> Option<T> {
if self.i >= self.universe_size { return None; }
let mut i = self.i;
loop {
if i >= self.universe_size {
self.i = i; // (mark iteration as complete.)
return None;
}
if self.set.contains(&T::new(i)) {
self.i = i + 1; // (next element to start at.)
return Some(T::new(i));
}
i = i + 1;
}
}
}
}

pub struct Iter<'a, T: Idx> {
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_mir/borrow_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
// Look for any active borrows to locals
let domain = flow_state.borrows.operator();
let data = domain.borrows();
flow_state.borrows.with_elems_outgoing(|borrows| {
flow_state.borrows.with_iter_outgoing(|borrows| {
for i in borrows {
let borrow = &data[i.borrow_index()];
self.check_for_local_borrow(borrow, span);
Expand All @@ -571,7 +571,7 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
// so this "extra check" serves as a kind of backup.
let domain = flow_state.borrows.operator();
let data = domain.borrows();
flow_state.borrows.with_elems_outgoing(|borrows| {
flow_state.borrows.with_iter_outgoing(|borrows| {
for i in borrows {
let borrow = &data[i.borrow_index()];
let context = ContextKind::StorageDead.new(loc);
Expand Down Expand Up @@ -1310,7 +1310,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
place
);

for i in flow_state.ever_inits.elems_incoming() {
for i in flow_state.ever_inits.iter_incoming() {
let init = self.move_data.inits[i];
let init_place = &self.move_data.move_paths[init.path].place;
if self.places_conflict(&init_place, place, Deep) {
Expand Down Expand Up @@ -2155,8 +2155,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {

// check for loan restricting path P being used. Accounts for
// borrows of P, P.a.b, etc.
let mut elems_incoming = flow_state.borrows.elems_incoming();
while let Some(i) = elems_incoming.next() {
let mut iter_incoming = flow_state.borrows.iter_incoming();
while let Some(i) = iter_incoming.next() {
let borrowed = &data[i.borrow_index()];

if self.places_conflict(&borrowed.borrowed_place, place, access) {
Expand Down
14 changes: 6 additions & 8 deletions src/librustc_mir/dataflow/at_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! locations.

use rustc::mir::{BasicBlock, Location};
use rustc_data_structures::indexed_set::{self, IdxSetBuf};
use rustc_data_structures::indexed_set::{IdxSetBuf, Iter};
use rustc_data_structures::indexed_vec::Idx;

use dataflow::{BitDenotation, BlockSets, DataflowResults};
Expand Down Expand Up @@ -117,23 +117,21 @@ where
}

/// Returns an iterator over the elements present in the current state.
pub fn elems_incoming(&self) -> iter::Peekable<indexed_set::Elems<BD::Idx>> {
let univ = self.base_results.sets().bits_per_block();
self.curr_state.elems(univ).peekable()
pub fn iter_incoming(&self) -> iter::Peekable<Iter<BD::Idx>> {
self.curr_state.iter().peekable()
}

/// Creates a clone of the current state and applies the local
/// effects to the clone (leaving the state of self intact).
/// Invokes `f` with an iterator over the resulting state.
pub fn with_elems_outgoing<F>(&self, f: F)
pub fn with_iter_outgoing<F>(&self, f: F)
where
F: FnOnce(indexed_set::Elems<BD::Idx>),
F: FnOnce(Iter<BD::Idx>),
{
let mut curr_state = self.curr_state.clone();
curr_state.union(&self.stmt_gen);
curr_state.subtract(&self.stmt_kill);
let univ = self.base_results.sets().bits_per_block();
f(curr_state.elems(univ));
f(curr_state.iter());
}
}

Expand Down