summary refs log tree commit diff
path: root/src/test/compile-fail/borrowck
AgeCommit message (Collapse)AuthorLines
2018-03-20Stabilize slice patterns without `..`Vadim Petrochenkov-5/+2
Merge `feature(advanced_slice_patterns)` into `feature(slice_patterns)`
2018-03-16Rollup merge of #48875 - jcowgill:mips-test-fixes, r=sanxiynkennytm-1/+3
MIPS testsuite fixes This PR adjusts various bits in the testsuite so that more stuff passes on mips*.
2018-03-09Complete re-implementation of 2-phase borrowsbobtwinkles-1/+0
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-09Finally start down the right pathbobtwinkles-16/+19
2018-03-08borrowck-asm: enable on mipsJames Cowgill-1/+3
2018-02-24Rollup merge of #48197 - bobtwinkles:two_phase_borrow_on_ops, r=nikomatsakisManish Goregaokar-53/+0
Allow two-phase borrows of &mut self in ops We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes #48129. CC @pnkfelix and @nikomatsakis r? @pnkfelix
2018-02-23update tests and reference filesNiko Matsakis-8/+4
The type checker invokes the borrow checker for closures it finds, so removing the NLL type checker affects ordering of errors somewhat.
2018-02-17Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakisbors-0/+30
add transform for uniform array move out reworked second step for fix #34708 previous try #46686 r? @nikomatsakis
2018-02-13Allow two-phase borrows of &mut self in opsbobtwinkles-53/+0
We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes #48129
2018-02-11Auto merge of #48092 - eddyb:discriminate-the-void, r=nikomatsakisbors-16/+16
rustc_mir: insert a dummy access to places being matched on, when building MIR. Fixes #47412 by adding a `_dummy = Discriminant(place)` before each `match place {...}`. r? @nikomatsakis
2018-02-09rustc_mir: insert a dummy access to places being matched on, when building MIR.Eduard-Mihai Burtescu-16/+16
2018-02-08add transform for uniform array move outMikhail Modin-0/+30
2018-02-08Fleshed out the test a lot more.Felix S. Klock II-9/+230
2018-02-08Test that autoref'ing beyond method receivers does not leak into two-phase ↵Felix S. Klock II-0/+39
borrows.
2018-02-08Restrict two-phase borrows to solely borrows introduced via autoref.Felix S. Klock II-18/+67
Added `-Z two-phase-beyond-autoref` to bring back old behavior (mainly to allow demonstration of desugared examples). Updated tests to use aforementioned flag when necessary. (But in each case where I added the flag, I made sure to also include a revision without the flag so that one can readily see what the actual behavior we expect is for the initial deployment of NLL.)
2018-01-03Auto merge of #46984 - arielb1:pre-statement-effect, r=nikomatsakisbors-1/+0
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-24Make killing of out-of-scope borrows a pre-statement effectAriel Ben-Yehuda-1/+0
Fixes #46875. Fixes #46917. Fixes #46935.
2017-12-23Give MIR borrowck a better understanding of inline asmMatthew Jasper-0/+97
2017-12-15Auto merge of #46537 - pnkfelix:two-phase-borrows, r=arielb1bors-0/+246
[MIR-borrowck] Two phase borrows This adds limited support for two-phase borrows as described in http://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/ The support is off by default; you opt into it via the flag `-Z two-phase-borrows` I have written "*limited* support" above because there are simple variants of the simple `v.push(v.len())` example that one would think should work but currently do not, such as the one documented in the test compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs (To be clear, that test is not describing something that is unsound. It is just providing an explicit example of a limitation in the implementation given in this PR. I have ideas on how to fix, but I want to land the work that is in this PR first, so that I can stop repeatedly rebasing this branch.)
2017-12-14Move compile-fail tests with NOTE/HELP annotations to UIVadim Petrochenkov-500/+0
2017-12-13Check activation points as the place where mutable borrows become relevant.Felix S. Klock II-11/+72
Since we are now checking activation points, I removed one of the checks at the reservation point. (You can see the effect this had on two-phase-reservation-sharing-interference-2.rs) Also, since we now have checks at both the reservation point and the activation point, we sometimes would observe duplicate errors (since either one independently interferes with another mutable borrow). To deal with this, I used a similar strategy to one used as discussed on issue #45360: keep a set of errors reported (in this case for reservations), and then avoid doing the checks for the corresponding activations. (This does mean that some errors could get masked, namely for conflicting borrows that start after the reservation but still conflict with the activation, which is unchecked when there was an error for the reservation. But this seems like a reasonable price to pay.)
2017-12-13two-phase-reservation-sharing-interference.rs variant that is perhaps more ↵Felix S. Klock II-0/+38
surprising.
2017-12-13test describing a currently unsupported corner case.Felix S. Klock II-0/+46
2017-12-13tests transcribed from nikos blog post.Felix S. Klock II-0/+101
2017-12-11Updated existing tests with new error messages.David Wood-4/+6
2017-12-06fix borrows across loops, libcore *almost* compilesAriel Ben-Yehuda-8/+2
2017-12-06handle gen/kill sets togetherAriel Ben-Yehuda-1/+5
2017-12-06improve conflict error reportingAriel Ben-Yehuda-2/+2
2017-12-06MIR borrowck: implement union-and-array-compatible semanticsAriel Ben-Yehuda-7/+10
Fixes #44831. Fixes #44834. Fixes #45537. Fixes #45696 (by implementing DerefPure semantics, which is what we want going forward).
2017-12-03add and unignore testsAriel Ben-Yehuda-0/+23
2017-11-28mir-borrowck: Update testsBasile Desloges-11/+23
2017-11-27Add initialization info to `MoveData`Matthew Jasper-0/+7
* Used for new dataflow to track if a variable has every been initialized * Used for other dataflows that need to be updated for initializations
2017-11-26Update tests for -Zborrowck-mir -> -Zborrowck=mode migrationest31-250/+145
2017-11-24Kill the storage for all locals on returning terminatorsKeith Yeung-0/+44
2017-11-23Fix borrowck compiler errors for upvars contain "spurious" dereferencesRamana Venkata-2/+13
Fixes #46003
2017-11-19mir-borrowck: Remove parens in the lvalue description of a derefBasile Desloges-7/+7
2017-11-17Do not registor borrows for unsafe lvaluesKeith Yeung-34/+0
2017-11-15Auto merge of #45938 - vramana:fix-ice-45698, r=arielb1bors-0/+24
Fix End-user description not implemented for field access on `TyClosure - [x] Add Tests
2017-11-15add `StorageDead` handlingMikhail Modin-0/+30
2017-11-15Auto merge of #45922 - vramana:fix-45702, r=nikomatsakisbors-6/+18
Fix MIR borrowck EndRegion not found Fixes #45702 - [x] Add Tests
2017-11-15Fix printing of upvar in closuresRamana Venkata-0/+24
2017-11-13mir-borrowck: Test for `check_access_permissions()`Basile Desloges-0/+76
2017-11-12Improve SubSupConflict case with one named, one anonymous lifetime parameter ↵Cengiz Can-1/+1
#42701
2017-11-11Fix MIR borrowck EndRegion not foundRamana Venkata-6/+18
Updated tests Fixes #45702
2017-11-08restore move out dataflow, add report of move out errorsMikhail Modin-3/+3
2017-11-02add TerminatorKind::FalseEdges and use it in matchesMikhail Modin-0/+42
2017-10-26Auto merge of #45519 - michaelwoerister:dedup-errors, r=arielb1bors-2/+0
Don't emit the same compiler diagnostic twice. This PR makes the compiler filter out diagnostic messages that have already been emitted during the same compilation session.
2017-10-25Reword to avoid using either re-assignment or reassignment in errorsCarol (Nichols || Goulding)-5/+5
2017-10-25Update compile-fail tests for error message deduplication.Michael Woerister-2/+0
2017-10-18run EndRegion when unwinding otherwise-empty scopesAriel Ben-Yehuda-1/+6
Improves #44832 borrowck-overloaded-index-move-index.rs - fixed borrowck-multiple-captures.rs - still ICE borrowck-issue-2657-1.rs - fixed borrowck-loan-blocks-move.rs - fixed borrowck-move-from-subpath-of-borrowed-path.rs - fixed borrowck-mut-borrow-linear-errors.rs - still ICE borrowck-no-cycle-in-exchange-heap.rs - fixed borrowck-unary-move.rs - fixed borrowck-loan-blocks-move-cc.rs - fixed borrowck-vec-pattern-element-loan.rs - still broken