summary refs log tree commit diff
path: root/src/librustc_mir/dataflow
AgeCommit message (Collapse)AuthorLines
2018-05-03Instrument `statement_effect_on_borrows` for the `lhs = &place` case.Felix S. Klock II-0/+6
2018-05-01rustc: return impl Iterator from Terminator(Kind)::successors(_mut).Eduard-Mihai Burtescu-3/+3
2018-04-15remove -Znll -- borrowck=mir implies nll nowNiko Matsakis-31/+20
2018-04-15stop using `borrows` for anything but iterating over live dataNiko Matsakis-26/+1
2018-04-15thread borrow-set around moreNiko Matsakis-3/+3
2018-04-15remove `ReserveOrActivateIndex`Niko Matsakis-62/+20
2018-04-15use the `activations_at_location` map to check activationsNiko Matsakis-0/+7
Not gen bits
2018-04-15encapsulate ReserveOrActivateIndex into the borrows dataflowNiko Matsakis-1/+0
2018-04-15construct the `BorrowSet` outside of `borrows`Niko Matsakis-8/+8
2018-04-15extract code to build borrow-set into `borrow_check::borrow_set`Niko Matsakis-404/+12
Also: - Extract common helper functions into a helper trait. - Kill a bit of dead code.
2018-04-15relocate `BorrowData` etc into `borrow_check::borrow_set`Niko Matsakis-77/+26
2018-04-15gather activation locations for 2-phase borrows in 1 passNiko Matsakis-98/+139
2018-04-15remove `assigned_map` (appears to be dead code)Niko Matsakis-9/+0
2018-04-07Auto merge of #49678 - bobtwinkles:fix_multiple_activations, r=nikomatsakisbors-14/+8
two-phase borrows: support multiple activations in one statement The need for this has arisen since the introduction of two-phase borrows on method autorefs in #49348. r'ing @pnkfelix to keep things off Niko's plate so he can make this redundant, and @pnkfelix is familiar with the code. Fixes #49635 Fixes #49662 r? @pnkfelix
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-1/+1
2018-04-04two-phase borrows: support multiple activations in one statementbobtwinkles-14/+8
The need for this has arisen since the introduction of two-phase borrows on method autorefs. Fixes 49635 Fixes 49662
2018-04-02avoid IdxSets containing garbage above the universe lengthAriel Ben-Yehuda-2/+2
This makes sure that all bits in each IdxSet between the universe length and the end of the word are all zero instead of being in an indeterminate state. This fixes a crash with RUST_LOG=rustc_mir, and is probably a good idea anyway.
2018-03-24Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakisbors-0/+2
NLL should identify and respect the lifetime annotations that the user wrote Part of #47184. r? @nikomatsakis
2018-03-22Added UserAssertTy statement.David Wood-0/+2
2018-03-17Use num::NonZero* instead of NonZero<_> in rustc and testsSimon Sapin-3/+3
2018-03-15Rollup merge of #48840 - varkor:idxset-cleanup, r=pnkfelixkennytm-18/+13
Remove some unnecessary IdxSet methods This replaces `IdxSet:: reset_to_empty` with `IdxSet:: clear`, and `IdxSet::elems`/`IdxSet::each_bit` with `IdxSet::iter`. Based on some [comments on #rustc](https://botbot.me/mozilla/rustc/2018-01-23/?msg=96063396). r? @pnkfelix
2018-03-09Remove some commented out codebobtwinkles-12/+0
Left over from prior experimentation, no longer required.
2018-03-09Check for two_phase_borrows in the right placebobtwinkles-1/+1
Fix a small compilation issue after I missed a critical change after rebasing yesterday (ref c933440)
2018-03-09Fix tests after two-phase borrow rewritebobtwinkles-19/+12
2018-03-09Remove unused field on BorrowDatabobtwinkles-3/+1
2018-03-09Complete re-implementation of 2-phase borrowsbobtwinkles-32/+32
See #48431 for discussion as to why this was necessary and what we hoped to accomplish. A brief summary: - the first implementation of 2-phase borrows was hard to limit in the way we wanted. That is, it was too good at accepting all 2-phase borrows rather than just autorefs =) - Numerous diagnostic regressions were introduced by 2-phase borrow support which were difficult to fix
2018-03-09mir dataflow: change graphviz outputbobtwinkles-142/+143
The new output format is perhaps a little more readable. As a bonus, we get labels on the outgoing edges to more easily corroborate the dataflow with the plain MIR graphviz output.
2018-03-09Finally start down the right pathbobtwinkles-371/+386
2018-03-09Rename BorrowData::location to BorrowData::reserve_locationbobtwinkles-4/+7
in preparation for rewritting two phase borrow support
2018-03-08Fully use miri in transOliver Schneider-1/+1
2018-03-06Remove IdxSet::elemsvarkor-8/+6
2018-03-06Remove IdxSet::each_bitvarkor-6/+3
2018-03-06Remove IdxSet::reset_to_emptyvarkor-4/+4
2018-03-02Run Rustfix on librustc_mirManish Goregaokar-1/+1
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-2/+3
2018-02-24Rollup merge of #48232 - fpoli:master, r=pnkfelixManish Goregaokar-3/+6
mir: Gather move at SwitchInt, Assert terminators Previously, `_1` was not marked as "definitely uninitialized" after a `switchInt(move _1)` terminator. I think the same goes for the `assert` terminator. Related discussion: https://internals.rust-lang.org/t/why-is-2-definitely-initialized-after-switchint-move-2/6760
2018-02-17fix more typos found by codespell.Matthias Krüger-2/+2
2018-02-15mir: Gather move at SwitchInt, Assert terminatorsFederico Poli-3/+6
Previously, "_1" was not marked as "definitely uninitialized" after a "switchInt(move _1)" terminator. Related discussion: https://internals.rust-lang.org/t/why-is-2-definitely-initialized-after-switchint-move-2/6760
2018-02-09Auto merge of #47802 - bobtwinkles:loop_false_edge, r=nikomatsakisbors-0/+10
[NLL] Add false edges out of infinite loops Resolves #46036 by adding a `cleanup` member to the `FalseEdges` terminator kind. There's also a small doc fix to one of the other comments in `into.rs` which I can pull out in to another PR if desired =) This PR should pass CI but the test suite has been relatively unstable on my system so I'm not 100% sure. r? @nikomatsakis
2018-02-08Encode (in MIR) whether borrows are explicit in source or arise due to autoref.Felix S. Klock II-1/+1
This is foundation for issue 46747 (limit two-phase borrows to method-call autorefs).
2018-02-05mir: Add TerminatorKind::FalseUnwindbobtwinkles-0/+10
Sometimes a simple goto misses the cleanup/unwind edges. Specifically, in the case of infinite loops such as those introduced by a loop statement without any other out edges. Analogous to TerminatorKind::FalseEdges; this new terminator kind is used when we want borrowck to consider an unwind path, but real control flow should never actually take it.
2018-02-03Auto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakisbors-0/+123
Generator bugfixes r? @nikomatsakis
2018-01-30Fix ICE when assigning references to a static mut with NLLAaron Hill-2/+1
is_unsafe_place only filters out statics in the rhs, not the lhs. Since it's possible to reach that 'Place::Static', we handle statics the same way as we do locals. Fixes #47789
2018-01-30Force locals to be live after they are borrowed for immovable generators. ↵John Kåre Alsaker-0/+123
Fixes #47736
2018-01-29rustc: replace "lvalue" terminology with "place" in the code.Eduard-Mihai Burtescu-62/+62
2018-01-27end_point handling multibyte characters correctly.David Wood-2/+2
2018-01-18in which the unused-parens lint comes to cover function and method argsZack M. Davis-1/+1
Resolves #46137.
2018-01-10Use the new fs_read_write functions in rustc internalsMatt Brubeck-2/+2
2018-01-03Auto merge of #46984 - arielb1:pre-statement-effect, r=nikomatsakisbors-3/+96
NLL fixes First, introduce pre-statement effects to dataflow to fix #46875. Edge dataflow effects might make that redundant, but I'm not sure of the best way to integrate them with liveness etc., and if this is a hack, this is one of the cleanest hacks I've seen. And I want a small fix to avoid the torrent of bug reports. Second, fix linking of projections to fix #46974 r? @pnkfelix
2017-12-26Auto merge of #46975 - matthewjasper:mir-moveck-asm, r=arielb1bors-2/+24
[MIR Borrowck] Moveck inline asm statements Closes #45695 New behavior: * Input operands to `asm!` are moved, direct output operands are initialized. * Direct, non-read-write outputs match the assignment changes in #46752 (Shallow writes, end borrows).