Skip to content

Improve borrowck field-sensitivity tests #14717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed

Improve borrowck field-sensitivity tests #14717

wants to merge 5 commits into from

Conversation

zwarich
Copy link

@zwarich zwarich commented Jun 7, 2014

After sitting down to build on the work merged in #14318, I realized that some of the test names were not clear, others probably weren't testing the right thing, and they were also not as exhaustive as they could have been.

Cameron Zwarich added 5 commits June 7, 2014 02:30
Some of the borrowck field-sensitivity test functions have 'use' in
their name, but they don't refer to the specific kind of use (whether a
copy or a deref). It would be better if the name more precisely
reflected what the function is testing.
A number of borrowck field-sensitivity tests perform more moves and
copies than their naming scheme would indicate. This is only necessary
for borrowed pointers (to ensure that the borrowws stay alive in the
near future when borrow liveness is tracked), but all other test
functions should be changed to match their name more closely.
Add more borrowck field-sensitivity tests for functional update moves.
This makes the collection of test functions more combinatorially
exhaustive.
The move_after_borrow / fu_move_after_borrow tests in
run-pass/borrowck-field-sensitivity.rs are not testing the right thing,
since the scope of the borrow is limited to the call to borrow(). When
fixed, these tests fail and thus should be moved to the corresponding
compile-fail test file.
Instead of calling a borrow() function that takes a pointer type, just
create a local pointer and dereference it. The dereference is there to
outsmart any future liveness analysis in borrowck.
bors added a commit that referenced this pull request Jun 7, 2014
After sitting down to build on the work merged in #14318, I realized that some of the test names were not clear, others probably weren't testing the right thing, and they were also not as exhaustive as they could have been.
@bors bors closed this Jun 7, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants