8000 Rollup of 13 pull requests by tmandry · Pull Request #65548 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 13 pull requests #65548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f04ea6c
Document JSON message output.
ehuss Sep 30, 2019
3b0fd82
Disable Go and OCaml bindings when building LLVM
tmiasko Oct 8, 2019
77f0aaf
Add more coherence tests
weiznich Oct 12, 2019
70b136d
Use a `BitSet` in `LexicalResolver::iterate_until_fixed_point()`.
nnethercote Oct 15, 2019
d51fee0
Inline and remove `iterate_until_fixed_point()`.
nnethercote Oct 16, 2019
42c0236
Use a sharded dep node to dep node index map
Zoxc Jun 13, 2019
d1db077
Add long error explanation for E0575
GuillaumeGomez Oct 12, 2019
21d9258
Update ui tests
GuillaumeGomez Oct 12, 2019
83e97c6
properly document panics in div_euclid and rem_euclid
tspiteri Oct 17, 2019
4cd9276
Add long error explanation for E0584
GuillaumeGomez Oct 17, 2019
f647c06
Update ui tests
GuillaumeGomez Oct 17, 2019
71b0049
Plugins deprecation: don’t suggest simply removing the attribute
SimonSapin Oct 17, 2019
a4d9492
add option to ping llvm ice-breakers to triagebot
nikomatsakis Oct 17, 2019
4e6efe4
reorder fmt docs for more clarity
RalfJung Oct 17, 2019
5487994
Update triagebot.toml
nikomatsakis Oct 17, 2019
c0b7e76
example for padding any format
RalfJung Oct 17, 2019
db94656
Update backtrace to 0.3.40
tmandry Oct 17, 2019
d0eaf60
Remove two no-op `into()` calls.
nnethercote Oct 15, 2019
a6eef29
Make `TokenStream::from_iter` less general and more efficient. 8000
nnethercote Oct 13, 2019
212ae58
Change `Lit::tokens()` to `Lit::token_tree()`.
nnethercote Oct 14, 2019
e4ec4a6
Change `MetaItem::tokens()` to `MetaItem::token_trees_and_joints()`.
nnethercote Oct 14, 2019
cb41fb6
Rollup merge of #64925 - ehuss:document-json, r=Mark-Simulacrum
tmandry Oct 18, 2019
d913212
Rollup merge of #65201 - tmiasko:no-bindings, r=rkruppe
tmandry Oct 18, 2019
a8ae1eb
Rollup merge of #65334 - GuillaumeGomez:long-err-explanation-E0575, r…
tmandry Oct 18, 2019
ce4349e
Rollup merge of #65417 - weiznich:more_coherence_tests, r=nikomatsakis
tmandry Oct 18, 2019
0a866a3
Rollup merge of #65455 - nnethercote:avoid-unnecessary-TokenTree-to-T…
tmandry Oct 18, 2019
7a49208
Rollup merge of #65472 - Zoxc:sharded-dep-graph-2, r=nikomatsakis
tmandry Oct 18, 2019
8cb6225
Rollup merge of #65480 - nnethercote:rm-iterate_until_fixed_size, r=n…
tmandry Oct 18, 2019
f1d4ce4
Rollup merge of #65493 - GuillaumeGomez:long-err-explanation-E0584, r…
tmandry Oct 18, 2019
0c6b6ad
Rollup merge of #65496 - tspiteri:euc-div-panic, r=KodrAus
tmandry Oct 18, 2019
570bc27
Rollup merge of #65498 - SimonSapin:plugin-help, r=Centril
tmandry Oct 18, 2019
8ccea93
Rollup merge of #65508 - rust-lang:llvm-icebreakers-ping-1, r=simulacrum
tmandry Oct 18, 2019
0e49753
Rollup merge of #65513 - RalfJung:fmt, r=Mark-Simulacrum
tmandry Oct 18, 2019
772a8d2
Rollup merge of #65531 - tmandry:bump-backtrace, r=cramertj
tmandry Oct 18, 2019
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
56 changes: 29 additions & 27 deletions src/librustc/infer/lexical_region_resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::graph::implementation::{
Direction, Graph, NodeIndex, INCOMING, OUTGOING,
};
use rustc_index::bit_set::BitSet;
use rustc_index::vec::{Idx, IndexVec};
use smallvec::SmallVec;
use std::fmt;
use syntax_pos::Span;

Expand Down Expand Up @@ -304,8 +304,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
}

fn expansion(&self, var_values: &mut LexicalRegionResolutions<'tcx>) {
8000 self.iterate_until_fixed_point(|constraint| {
debug!("expansion: constraint={:?}", constraint);
let mut process_constraint = |constraint: &Constraint<'tcx>| {
let (a_region, b_vid, b_data, retain) = match *constraint {
Constraint::RegSubVar(a_region, b_vid) => {
let b_data = var_values.value_mut(b_vid);
Expand All @@ -331,7 +330,33 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {

let changed = self.expand_node(a_region, b_vid, b_data);
(changed, retain)
})
};

// Using bitsets to track the remaining elements is faster than using a
// `Vec` by itself (which requires removing elements, which requires
// element shuffling, which is slow).
let constraints: Vec<_> = self.data.constraints.keys().collect();
let mut live_indices: BitSet<usize> = BitSet::new_filled(constraints.len());
let mut killed_indices: BitSet<usize> = BitSet::new_empty(constraints.len());
let mut changed = true;
while changed {
changed = false;
for index in live_indices.iter() {
let constraint = constraints[index];
let (edge_changed, retain) = process_constraint(constraint);
if edge_changed {
changed = true;
}
if !retain {
let changed = killed_indices.insert(index);
debug_assert!(changed);
}
}
live_indices.subtract(&killed_indices);

// We could clear `killed_indices` here, but we don't need to and
// it's cheaper not to.
}
}

// This function is very hot in some workloads. There's a single callsite
Expand Down Expand Up @@ -866,29 +891,6 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
}
}

fn iterate_until_fixed_point<F>(&self, mut body: F)
where
F: FnMut(&Constraint<'tcx>) -> (bool, bool),
{
let mut constraints: SmallVec<[_; 16]> = self.data.constraints.keys().collect();
let mut iteration = 0;
let mut changed = true;
while changed {
changed = false;
iteration += 1;
debug!("---- Expansion iteration {}", iteration);
constraints.retain(|constraint| {
let (edge_changed, retain) = body(constraint);
if edge_changed {
debug!("updated due to constraint {:?}", constraint);
changed = true;
}
retain
});
}
debug!("---- Expansion complete after {} iteration(s)", iteration);
}

fn bound_is_met(
&self,
bound: &VerifyBound<'tcx>,
Expand Down
0