about summary refs log tree commit diff
path: root/src/test/ui/nll/polonius
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-401/+0
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-06-03Fully stabilize NLLJack Huey-23/+16
2021-09-25Use larger span for adjustments on method callsAaron Hill-2/+2
Currently, we use a relatively 'small' span for THIR expressions generated by an 'adjustment' (e.g. an autoderef, autoborrow, unsizing). As a result, if a borrow generated by an adustment ends up causing a borrowcheck error, for example: ```rust let mut my_var = String::new(); let my_ref = &my_var my_var.push('a'); my_ref; ``` then the span for the mutable borrow may end up referring to only the base expression (e.g. `my_var`), rather than the method call which triggered the mutable borrow (e.g. `my_var.push('a')`) Due to a quirk of the MIR borrowck implementation, this doesn't always get exposed in migration mode, but it does in many cases. This commit makes THIR building consistently use 'larger' spans for adjustment expressions The intent of this change it make it clearer to users when it's the specific way in which a variable is used (for example, in a method call) that produdes a borrowcheck error. For example, an error message claiming that a 'mutable borrow occurs here' might be confusing if it just points at a usage of a variable (e.g. `my_var`), when no `&mut` is in sight. Pointing at the entire expression should help to emphasize that the method call itself is responsible for the mutable borrow. In several cases, this makes the `#![feature(nll)]` diagnostic output match up exactly with the default (migration mode) output. As a result, several `.nll.stderr` files end up getting removed entirely.
2020-12-01Added better error message for shared borrow treated as unique for purposes ↵PankajChaudhary5-4/+4
of lifetimes
2019-12-06add subset relations test using poloniusRemy Rakic-0/+44
It's a relatively simple smoke-test for subset errors, executed outside of the polonius compare-mode.
2019-10-02Calculate liveness for the same locals with and without -ZpoloniusMatthew Jasper-1/+3
This fixes some test differences and also avoids overflow in issue-38591.rs.
2019-07-22fix tidylqd-1/+1
2019-07-22issue-46589 passes in Polonius and fails in NLL, duplicate it and manually ↵lqd-0/+32
check each outcome
2019-07-22Add test to check that assignments to projections do not kill too many loanslqd-0/+101
2019-07-22Add test checking various assignments are accepted in Poloniuslqd-0/+88
2019-07-22Make both polonius loans tests check-passlqd-2/+2
2019-07-22Rename test so that both "kills-loans" tests match nameslqd-1/+2
2019-07-22Add test extracted from rand, checking that StorageDead kills loanslqd-0/+28
Like "call-kills-loans", Polonius didn't know about some `killed` facts.
2019-07-22Polonius facts: kill loans on Call terminators and StorageDeadlqd-0/+24
2019-07-22Create a dedicated polonius test folderlqd-0/+88