summary refs log tree commit diff
path: root/src/test/ui/borrowck
AgeCommit message (Collapse)AuthorLines
2019-03-16Make migrate mode work at item level granularityMatthew Jasper-0/+100
2019-02-23Rollup merge of #58199 - clintfred:partial-move-err-msg, r=estebankMazdak Farrokhzad-2/+2
Add better error message for partial move closes #56657 r? @davidtwco
2019-02-20./x.py test src/test/ui --stage 1 --bless -i --compare-mode=nllClint Frederickson-1/+1
2019-02-20Fix erroneous loop diagnostic in nllSantiago Pastorino-9/+9
This commit fixes the logic of detecting when a use happen in a later iteration of where a borrow was defined Fixes #53773
2019-02-18re-blessing error output: ./x.py test src/test/ui --stage 1 --blessClint Frederickson-18/+18
2019-02-06error output updated by ./x.py test --stage 1 src/test/ui --incremental --blessClint Frederickson-18/+18
2019-02-05[WIP] add better error message for partial moveClint Frederickson-1/+1
2019-01-26Replace deprecated ATOMIC_INIT constsMark Rousskov-1/+1
2019-01-24Fix --compare-mode=nll testsEsteban Küber-42/+66
2019-01-24review commentsEsteban Küber-4/+1
2019-01-24Point at type argument suggesting adding `Copy` constraintEsteban Küber-0/+2
2019-01-24When using value after move, point at span of localEsteban Küber-27/+35
When trying to use a value after move, instead of using a note, point at the local declaration that has a type that doesn't implement `Copy` trait.
2019-01-13Rollup merge of #57102 - davidtwco:issue-57100, r=nikomatsakisMazdak Farrokhzad-108/+89
NLL: Add union justifications to conflicting borrows. Fixes #57100. This PR adds justifications to error messages for conflicting borrows of union fields. Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``. r? @pnkfelix
2019-01-04Improve diagnostic labels and add note.David Wood-9/+15
This commit improves diagnostic labels to mention which field a borrow overlaps with and adds a note explaining that the fields overlap.
2018-12-29add non-copy note to stderrcsmoe-33/+30
2018-12-27retrieve ty info from place_tycsmoe-2/+2
describe index with _
2018-12-26Add union justifications to conflicting borrows.David Wood-101/+76
This commit adds justifications to error messages for conflicting borrows of union fields. Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``.
2018-12-25Remove licensesMark Rousskov-3165/+1260
2018-12-25Auto merge of #57088 - euclio:non-camel-case-early-lint, r=estebankbors-59/+56
make non_camel_case_types an early lint This allows us to catch these kinds of style violations much earlier, as evidenced by the large number of tests that had to be updated for this change.
2018-12-25Auto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelixbors-10/+9
address some FIXME whose associated issues were marked as closed part of #44366
2018-12-24make non_camel_case_types an early lintAndy Russell-59/+56
2018-12-23bless ui tests in compare modeNiv Kaminer-3/+3
2018-12-22Update migrate warning wording.David Wood-15/+10
This commit modifies the wording of the warning for backwards-incompatible changes in migrate mode. The warning messages are changed to be lowercase and not include line-breaks in order to be consistent with other compiler diagnostics.
2018-12-19FIXME(21232) update fixme to point to the open issue about accepting partial ↵Niv Kaminer-1/+1
initialization
2018-12-19FIXME(49824) remove fixme because there is no free region error anymoreNiv Kaminer-6/+5
2018-12-13Make determining the discriminant a normal Shallow readMatthew Jasper-2/+31
Enum layout optimizations mean that the discriminant of an enum may not be stored in a tag disjoint from the rest of the fields of the enum. Stop borrow checking as though they are.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-05Rollup merge of #56372 - wildarch:issue-55314-second-borrow-ref, r=davidtwcoPietro Albini-1/+1
Refer to the second borrow as the "second borrow" in E0501.rs Fixes #55314. r? @davidtwco
2018-12-04Update testsOliver Scherer-25/+52
2018-11-30Refer to the second borrow as the "second borrow".Daan de Graaf-1/+1
2018-11-18Remove mir::StatementKind::EndRegionMatthew Jasper-1/+1
Since lexical MIR borrow check is gone, and validation no longer uses these, they can be removed.
2018-11-11Auto merge of #55657 - davidtwco:issue-55651, r=pnkfelixbors-25/+13
NLL Diagnostic Review 3: Unions not reinitialized after assignment into field Fixes #55651, #55652. This PR makes two changes: First, it updates the dataflow builder to add an init for the place containing a union if there is an assignment into the field of that union. Second, it stops a "use of uninitialized" error occuring when there is an assignment into the field of an uninitialized union that was previously initialized. Making this assignment would re-initialize the union, as tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`. The check for previous initialization ensures that we do not start supporting partial initialization yet (cc #21232, #54499, #54986). This PR also fixes #55652 which was marked as requiring investigation as the changes in this PR add an error that was previously missing (and mentioned in the review comments) and confirms that the error that was present is correct and a result of earlier partial initialization changes in NLL. r? @pnkfelix (due to earlier work with partial initialization) cc @nikomatsakis
2018-11-11Rollup merge of #55801 - pnkfelix:update-box-insensitivity-test-for-nll, ↵Pietro Albini-86/+103
r=davidtwco NLL: Update box insensitivity test This is just keeping one of our tests honest with respect to NLL, in two ways: 1. Adds uses of borrows that would otherwise be too short to observe the error that we would have expected to see... 2. ... I say "would have expected" because all of the errors in this file are part of the reversion of rust-lang/rfcs#130 that is attached to NLL (you can see more discussion of this here https://github.com/rust-lang/rust/issues/43234#issuecomment-411017768 )
2018-11-10Auto merge of #55637 - ↵bors-0/+31
pnkfelix:issue-55552-dont-attempt-to-ascribe-projections-out-of-a-ty-var, r=nikomatsakis Do not attempt to ascribe projections out of a ty var If we encounter `_` ascribed to structural pattern like `(a, b)`, just skip relate_types. Fix #55552
2018-11-09Fix the expected error annotations.Felix S. Klock II-65/+65
(The commit prior to this actual passes our test suite, "thanks" to #55695. But since I am aware of that bug, I took advantage of it in choosing how to order my commit series...)
2018-11-09Switch to using `// revisions` to explicit encode NLL's change to `Box` ↵Felix S. Klock II-8/+22
treatment.
2018-11-09Make test robust to NLL, in sense of ensuring borrows extend to something ↵Felix S. Klock II-14/+17
approximating lexical scope.
2018-11-05Make `ui/borrowck/borrowck-overloaded-call.rs` robust w.r.t. NLL.Felix S. Klock II-3/+16
2018-11-05Update `ui/borrowck/borrowck-closures-mut-of-imm.rs` robust w.r.t. NLL.Felix S. Klock II-25/+43
2018-11-05Add `ui/borrowck/borrowck-closures-mut-of-mut.rs`.Felix S. Klock II-0/+56
This is a variant of `ui/borrowck/borrowck-closures-mut-of-imm.rs` that I used to help identify what changes I needed to make to the latter file in order to recover its instances of E0524 under NLL. (Basically this test includes the changes you'd need to make to `ui/borrowck/borrowck-closures-mut-of-imm.rs` in order to get rid of occurrences of E0596. And then I realized that one needs to add invocations of the closures in order to properly extend the mutable reborrows in a manner such that NLL will roughly match AST-borrowck.)
2018-11-05Make `ui/borrowck/borrowck-unboxed-closures.rs` robust w.r.t. NLL.Felix S. Klock II-3/+16
2018-11-05Make `ui/borrowck/borrowck-reborrow-from-mut.rs` robust w.r.t. NLL.Felix S. Klock II-19/+135
2018-11-05Make `ui/borrowck/borrowck-overloaded-index-move-index.rs` robust w.r.t. NLL.Felix S. Klock II-2/+31
2018-11-05Switch to using revisions in borrowck-lend-flow-loop.rsFelix S. Klock II-41/+41
Most of the time we want to robustify tests, but in this case this test is deliberately encoding artifacts of AST-borrowck. So instead of adding artificial uses that would obscure the aspects of AST-borrowck that are being tests, we instead use revisions and then mark the cases that apply to NLL as well as AST-borrowck.
2018-11-03Unions reinitialized after assignment into field.David Wood-25/+13
This commit makes two changes: First, it updates the dataflow builder to add an init for the place containing a union if there is an assignment into the field of that union. Second, it stops a "use of uninitialized" error occuring when there is an assignment into the field of an uninitialized union that was previously initialized. Making this assignment would re-initialize the union, as tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`. The check for previous initialization ensures that we do not start supporting partial initialization yet (cc #21232, #54499, #54986).
2018-11-03Regression test for issue 55552.Felix S. Klock II-0/+31
2018-10-30Rollup merge of #55494 - ↵kennytm-32/+233
pnkfelix:issue-55492-borrowck-migrate-must-look-at-parents-of-closures, r=davidtwco borrowck=migrate must look at parents of closures This fixes the NLL migration mode (which is the default with edition=2018) to inspect all parents of a closure in addition to the closure itself when looking to see if AST-borrowck issues an error for the given code. This should be a candidate for beta backport. Fix #55492
2018-10-30Update compare-mode=nll stderr files to reflect the fix to #55492.Felix S. Klock II-32/+9
2018-10-30Regression test for issue 55492.Felix S. Klock II-0/+224
2018-10-29Don't emit cannot move errors twice in migrate modeMatthew Jasper-334/+13