Skip to content

several ui tests need to be strengthened to properly test NLL mode #51025

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
26 tasks
pnkfelix opened this issue May 24, 2018 · 0 comments
Closed
26 tasks

several ui tests need to be strengthened to properly test NLL mode #51025

pnkfelix opened this issue May 24, 2018 · 0 comments
Labels
A-NLL Area: Non-lexical lifetimes (NLL)

Comments

@pnkfelix
Copy link
Member

pnkfelix commented May 24, 2018

The following tests fail to report the intended errors (most often it is missing the intended number of errors; sometimes failing to report any error at all), not because of a bug in the compiler, but rather because the test was written in a manner that assumes lexical lifetimes.

This issue is just documenting these cases (and I will try to add to the list if more are discovered); a follow-up PR will have the necessary updates to the tests.

(Some of the cases currently listed are only currently slated as "needs investigation", either to whether it should be strengthened, or what the original intent of the test even was, etc. As those questions are resolved, they will be either have their checkbox marked, or just crossed off entirely.)

  • borrowck/borrowck-report-with-custom-diagnostic.rs
  • borrowck/mut-borrow-outside-loop.rs
  • codemap_tests/issue-11715.rs
  • codemap_tests/one_line.rs
    • this is not an obvious instance of "weak test"; needs further review
  • codemap_tests/overlapping_spans.rs
    • this is a weak test (in the opinion of @pnkfelix ) but its not obvious what the right fix is in order to recover the (hypothesized) original intent.
    • Thus, deferring to another issue (TBD).
  • dropck/dropck-eyepatch-extern-crate.rs
  • dropck/dropck-eyepatch-reorder.rs
  • dropck/dropck-eyepatch.rs
  • error-codes/E0499.rs
  • error-codes/E0502.rs
  • error-codes/E0503.rs
  • error-codes/E0505.rs
  • error-codes/E0597.rs
  • generator/dropck.rs
  • generator/pattern-borrow.rs
  • hygiene/fields-numeric-borrowck.rs
  • issue-17263.rs
    • this was miscategorized initially. I believe it is actually a case where NLL has reenabled smart reasoning about Box, which was intended.
  • issue-25793.rs
  • issue-42106.rs
  • lifetime-errors/ex3-both-anon-regions-2.rs (?)
    • see NLL diagnostics fail to report lifetime mismatches #51029 in particular; its not 100% clear that this is merely a weak test.
    • huh; I changed my mind. Found way to strengthen test I'm happy with. Should double-check original intent of test vs ifetime-errors/ex3-both-anon-regions.rs though.
  • lifetimes/borrowck-let-suggestion.rs
  • span/borrowck-let-suggestion-suffixes.rs
  • span/issue-36537.rs
  • span/mut-ptr-cant-outlive-ref.rs
  • span/range-2.rs
  • span/regionck-unboxed-closure-lifetimes.rs
  • span/send-is-not-static-std-sync.rs
  • span/slice-borrow.rs
  • span/vec_refs_data_with_early_death.rs

(This list of tests is drawn from an informal paper document that I have been using to keep notes for myself as I work on this...)

@pnkfelix pnkfelix added A-NLL Area: Non-lexical lifetimes (NLL) WG-compiler-nll labels May 24, 2018
pnkfelix added a commit to pnkfelix/rust that referenced this issue May 25, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 26, 2018
…robust-wrt-nll, r=nikomatsakis

make ui tests robust with respect to NLL

This PR revises the `ui` tests that I could quickly identify that:
 1. previously had successful compilations under non-lexical lifetimes (NLL) because they assumed lexical lifetimes, but
 2. such assumption of lexical lifetimes was actually not necessarily part of the spirit of the original issue/bug we want to witness.

In many cases, this is simply a matter of adding a use of a borrow so that it gets extended long enough to observe a conflict.

(In some cases the revision was more subtle, such as adding a destructor, or revising the order of declaration of some variables.)

----

With these test revisions in place, I subsequently updated the expected stderr output under the NLL compiletest mode. So now we should get even more testing of NLL than we were before.

Fix rust-lang#51025
@pnkfelix pnkfelix changed the title several ui tests need to be strenghtened to properly test NLL mode several ui tests need to be strengthened to properly test NLL mode Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-NLL Area: Non-lexical lifetimes (NLL)
Projects
None yet
Development

No branches or pull requests

1 participant