Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
047aac5
Flesh out struct keyword docs
iirelu Sep 3, 2018
1142bbd
Add docs for `as` keyword
iirelu Sep 3, 2018
c1bd8a9
Add keyword docs on const
iirelu Sep 3, 2018
6cbcfa2
Fix a few small things, re-word others
iirelu Sep 3, 2018
f8d6261
Add docs for `crate` keyword
iirelu Sep 5, 2018
f15a1ec
Add keyword docs on `enum`
iirelu Sep 6, 2018
f91ad44
Add docs on `extern` keyword
iirelu Sep 9, 2018
a5c4a38
Expand fn keyword docs
iirelu Sep 9, 2018
f7a6638
Document `for` keyword
iirelu Sep 10, 2018
5d05ae7
Document `if` keyword.
iirelu Sep 12, 2018
5393b27
Incorporate keyword doc PR critique
iirelu Sep 14, 2018
738e58d
Document impl keyword
iirelu Sep 19, 2018
165690b
Rework `let` keyword docs
iirelu Sep 19, 2018
76a353b
Add keyword docs for `loop`.
iirelu Sep 24, 2018
50f631c
Removed dead links to unwritten keyword docs
iirelu Sep 26, 2018
577dbc8
Incorporate criticisms into keyword docs
iirelu Sep 26, 2018
619dfeb
Remove the last broken link.
iirelu Sep 26, 2018
63c471e
rustc: Tweak filenames encoded into metadata
alexcrichton Sep 27, 2018
e961d39
Add line numbers option to rustdoc
GuillaumeGomez Oct 8, 2018
c514b62
update tcp stream documentation
Oct 10, 2018
c77a0cf
Accept `Option<Box<$t:ty>>` in macro argument
estebank Oct 10, 2018
4530b8c
Small changes to fix documentation auto compile issues
Oct 11, 2018
f8550a4
Add doc for impl From for Waker
phungleson Aug 20, 2018
a70ef6a
Seems like we don't have to refer the file anymore.
phungleson Oct 16, 2018
475be10
in which unused-parens suggestions heed what the user actually wrote
zackmdavis Oct 17, 2018
655f9d8
Move cg_llvm::back::linker to cg_utils
bjorn3 Oct 20, 2018
9378705
submodules: update clippy from 5afdf8b7 to b1d03437
matthiaskrgr Oct 21, 2018
0f6e274
Clarified code example
peterjoel Oct 21, 2018
9f70096
Fix a typo in the documentation of RangeInclusive
meithecatte Oct 21, 2018
b0d3d3b
only issue "variant of the expected type" suggestion for enums
zackmdavis Oct 21, 2018
c675111
Correct trailing ellipsis in name_from_pat
varkor Oct 21, 2018
412ad9b
Allow extern statics with an extern type
mjbshaw Oct 22, 2018
9f0a352
Turn ICE for dangling pointers into error
oli-obk Oct 22, 2018
5b84550
Keep an obligation for both sized and unsized types
mjbshaw Oct 22, 2018
0ba1262
Reproduce the underlying issue
oli-obk Oct 22, 2018
80a6b73
Unimplement ExactSizeIterator
sinkuu Oct 22, 2018
b5336c0
Add a cheap mode for `compute_missing_ctors`.
nnethercote Oct 17, 2018
e1e52eb
Suggest appropriate syntax on missing lifetime specifier in return type
estebank Oct 18, 2018
d0bd69a
review comments
estebank Oct 18, 2018
dd91c8f
[review comments] modify test and clean up code
oli-obk Oct 19, 2018
4f2624c
Fix Rustdoc ICE when checking blanket impls
Aaron1011 Oct 22, 2018
fda3326
Remove redundant clone
sinkuu Oct 23, 2018
2d960a5
Update dangling-alloc-id-ice-2.rs
oli-obk Oct 23, 2018
8d6ee8f
Do some copy editing on the release notes
carols10cents Oct 23, 2018
4972bea
fix typos in various places
matthiaskrgr Oct 22, 2018
3d9231c
Update stdsimd submodule
kazcw Oct 23, 2018
320ec81
Hopefully fix compile error
iirelu Oct 23, 2018
3539132
Update comment based on suggestion.
phungleson Oct 23, 2018
f2443a9
Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs
cuviper Oct 23, 2018
398a264
Update compiler-builtins submodule
alexcrichton Oct 24, 2018
be2075c
This is a regression test for #54478.
pnkfelix Oct 24, 2018
f5bc109
Rollup merge of #53507 - phungleson:fix-impl-from-for-waker, r=cramertj
kennytm Oct 24, 2018
28bde7f
Rollup merge of #54626 - alexcrichton:dwarf-generics, r=michaelwoerister
kennytm Oct 24, 2018
60c3626
Rollup merge of #54965 - chathaway-codes:update-tcp-stream-docs, r=Gu…
kennytm Oct 24, 2018
f3858f8
Rollup merge of #54977 - estebank:macro-arg-parse, r=pnkfelix
kennytm Oct 24, 2018
6ffbde2
Rollup merge of #55138 - zackmdavis:the_paren_trap, r=pnkfelix
kennytm Oct 24, 2018
f2d335b
Rollup merge of #55167 - nnethercote:is_missing_ctors_empty, r=varkor
kennytm Oct 24, 2018
942a162
Rollup merge of #55173 - estebank:suggest-static, r=oli-obk
kennytm Oct 24, 2018
848c2b7
Rollup merge of #55225 - bjorn3:rustc_link, r=cramertj
kennytm Oct 24, 2018
2eff59f
Rollup merge of #55245 - matthiaskrgr:clippy, r=nikomatsakis
kennytm Oct 24, 2018
7f06f15
Rollup merge of #55247 - peterjoel:peterjoel-prim-char-doc-example, r…
kennytm Oct 24, 2018
10e99ff
Rollup merge of #55251 - NieDzejkob:master, r=TimNN
kennytm Oct 24, 2018
c562357
Rollup merge of #55253 - zackmdavis:some_suggestion, r=pnkfelix
kennytm Oct 24, 2018
5b22503
Rollup merge of #55254 - rust-lang:clean-two-dots, r=GuillaumeGomez
kennytm Oct 24, 2018
3e6d322
Rollup merge of #55257 - mjbshaw:static, r=oli-obk
kennytm Oct 24, 2018
c8ead34
Rollup merge of #55258 - Aaron1011:fix/rustdoc-blanket, r=GuillaumeGomez
kennytm Oct 24, 2018
c2463af
Typo
oli-obk Oct 24, 2018
0b82e03
Documents `From` implementations for `Stdio`
octronics Oct 19, 2018
538f65e
Fix doc for new copysign functions
raphlinus Oct 24, 2018
aa85e3e
Rollup merge of #55269 - matthiaskrgr:typos_oct, r=zackmdavis
kennytm Oct 24, 2018
b2071e7
Rollup merge of #55271 - sinkuu:traversal_iter, r=matthewjasper
kennytm Oct 24, 2018
71b94aa
Rollup merge of #55282 - sinkuu:redundant_clone, r=estebank
kennytm Oct 24, 2018
a7e4adf
Rollup merge of #55285 - integer32llc:release-notes-improvements, r=A…
kennytm Oct 24, 2018
163ffa0
Rollup merge of #55291 - kazcw:master, r=nikomatsakis
kennytm Oct 24, 2018
4e3cb07
Rollup merge of #55303 - alexcrichton:update-libm, r=kennytm
kennytm Oct 24, 2018
2fe4308
Rollup merge of #53931 - iirelu:keyword-docs, r=steveklabnik
kennytm Oct 25, 2018
5221790
Rollup merge of #55200 - octronics:gh51430, r=kennytm
kennytm Oct 25, 2018
3b2ea2b
Rollup merge of #55296 - cuviper:rustdoc-ui-backtrace, r=nikomatsakis
kennytm Oct 25, 2018
d307d8a
Rollup merge of #55306 - pnkfelix:issue-54478-regression-test-jemallo…
kennytm Oct 25, 2018
8419761
Rollup merge of #55328 - raphlinus:copysign_typo, r=joshtriplett
kennytm Oct 25, 2018
7d1165c
Rollup merge of #54921 - GuillaumeGomez:line-numbers, r=QuietMisdreavus
kennytm Oct 25, 2018
bff4637
Rollup merge of #55262 - oli-obk:dangling_alloc_id_ice, r=RalfJung
kennytm Oct 25, 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
36 changes: 24 additions & 12 deletions src/librustc/mir/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub struct Preorder<'a, 'tcx: 'a> {
mir: &'a Mir<'tcx>,
visited: BitSet<BasicBlock>,
worklist: Vec<BasicBlock>,
root_is_start_block: bool,
}

impl<'a, 'tcx> Preorder<'a, 'tcx> {
Expand All @@ -44,6 +45,7 @@ impl<'a, 'tcx> Preorder<'a, 'tcx> {
mir,
visited: BitSet::new_empty(mir.basic_blocks().len()),
worklist,
root_is_start_block: root == START_BLOCK,
}
}
}
Expand Down Expand Up @@ -75,15 +77,19 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> {

fn size_hint(&self) -> (usize, Option<usize>) {
// All the blocks, minus the number of blocks we've visited.
let remaining = self.mir.basic_blocks().len() - self.visited.count();
let upper = self.mir.basic_blocks().len() - self.visited.count();

// We will visit all remaining blocks exactly once.
(remaining, Some(remaining))
let lower = if self.root_is_start_block {
// We will visit all remaining blocks exactly once.
upper
} else {
self.worklist.len()
};

(lower, Some(upper))
}
}

impl<'a, 'tcx> ExactSizeIterator for Preorder<'a, 'tcx> {}

/// Postorder traversal of a graph.
///
/// Postorder traversal is when each node is visited after all of it's
Expand All @@ -105,15 +111,17 @@ impl<'a, 'tcx> ExactSizeIterator for Preorder<'a, 'tcx> {}
pub struct Postorder<'a, 'tcx: 'a> {
mir: &'a Mir<'tcx>,
visited: BitSet<BasicBlock>,
visit_stack: Vec<(BasicBlock, Successors<'a>)>
visit_stack: Vec<(BasicBlock, Successors<'a>)>,
root_is_start_block: bool,
}

impl<'a, 'tcx> Postorder<'a, 'tcx> {
pub fn new(mir: &'a Mir<'tcx>, root: BasicBlock) -> Postorder<'a, 'tcx> {
let mut po = Postorder {
mir,
visited: BitSet::new_empty(mir.basic_blocks().len()),
visit_stack: Vec::new()
visit_stack: Vec::new(),
root_is_start_block: root == START_BLOCK,
};


Expand Down Expand Up @@ -214,15 +222,19 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {

fn size_hint(&self) -> (usize, Option<usize>) {
// All the blocks, minus the number of blocks we've visited.
let remaining = self.mir.basic_blocks().len() - self.visited.count();
let upper = self.mir.basic_blocks().len() - self.visited.count();

// We will visit all remaining blocks exactly once.
(remaining, Some(remaining))
let lower = if self.root_is_start_block {
// We will visit all remaining blocks exactly once.
upper
} else {
self.visit_stack.len()
};

(lower, Some(upper))
}
}

impl<'a, 'tcx> ExactSizeIterator for Postorder<'a, 'tcx> {}

/// Reverse postorder traversal of a graph
///
/// Reverse postorder is the reverse order of a postorder traversal.
Expand Down