-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add test for NLL: unexpected "free region `` does not outlive" error #52793
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
@davidtwco Since the test uses (that is, I don't want someone who's idly skimming |
Actually ... why are you using My interpretation of our request for a test is that we want one that reflects the end user's experience. We don't need to be exploring the internals of the region requirements here. |
@pnkfelix I've updated the test to remove |
@bors r+ rollup |
📌 Commit 4488d5530a840f442543c8c144fa46e973e23d9b has been approved by |
@bors r- |
@davidtwco so you can tell that I changed my mind about something here. This test represents a case where NLL could break old code that was accepted by the AST-borrowck. Its exactly the kind of case where I think the right approach is not to use At the very least, I would remove the |
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![feature(rustc_attrs)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment noting that this test is checking a problem that only arises in NLL mode, and maybe a pointer to the issue-49824.nll.stderr file, just so someone who looks over these tests in the futures doesn't think that this test is a no-op.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@bors r+ rollup |
📌 Commit 8bbf042 has been approved by |
Add test for NLL: unexpected "free region `` does not outlive" error Fixes rust-lang#49824. r? @pnkfelix @nikomatsakis
Rollup of 15 pull requests Successful merges: - #52793 (Add test for NLL: unexpected "free region `` does not outlive" error ) - #52799 (Use BitVector for global sets of AttrId) - #52809 (Add test for unexpected region for local data ReStatic) - #52834 ([NLL] Allow conflicting borrows of promoted length zero arrays) - #52835 (Fix Alias intra doc ICE) - #52854 (fix memrchr in miri) - #52899 (tests/ui: Add missing mips{64} ignores) - #52908 (Use SetLenOnDrop in Vec::truncate()) - #52915 (Don't count MIR locals as borrowed after StorageDead when finding locals live across a yield terminator) - #52926 (rustc: Trim down the `rust_2018_idioms` lint group) - #52930 (rustc_resolve: record single-segment extern crate import resolutions.) - #52939 (Make io::Read::read_to_end consider io::Take::limit) - #52942 (Another SmallVec.extend optimization) - #52947 (1.27 actually added the `armv5te-unknown-linux-musleabi` target) - #52954 (async can begin expressions) Failed merges: r? @ghost
Fixes #49824.
r? @pnkfelix @nikomatsakis