Skip to content
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

NLL diagnostics: revise fn check_access_permissions #51275

Merged

Commits on Jun 19, 2018

  1. Thread info about form of variable bindings, including spans of arg t…

    …ypes, down into `mir::LocalDecls`.
    
    As a drive-by: the ref_for_guards created by `fn declare_binding`
    should not have been tagged as user_variables in the first
    place. These secret internal locals are *pointers* to user variables,
    but themselves are not such (IMO. For now at least.)
    pnkfelix committed Jun 19, 2018
    Configuration menu
    Copy the full SHA
    cac6126 View commit details
    Browse the repository at this point in the history
  2. Refactor: Replace anonymous-tuple with tuple struct as prep for addin…

    …g more fields in future.
    pnkfelix committed Jun 19, 2018
    Configuration menu
    Copy the full SHA
    e848fe0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c5c4c5e View commit details
    Browse the repository at this point in the history
  4. Thread more argument info down from Hir into the mir::LocalDecls.

    Namely, we thread down the `HirId` of the explicit type of the
    argument.  In the case of the special `self` variable with an implicit
    type, we also thread down a description of its structure (`self`/`mut
    self`/`&self`/`&mut self`).
    pnkfelix committed Jun 19, 2018
    Configuration menu
    Copy the full SHA
    be645be View commit details
    Browse the repository at this point in the history
  5. small refactoring: replaced mutable state with return statements in…

    … control flow.
    
    As a drive-by, removed some dead-code.
    pnkfelix committed Jun 19, 2018
    Configuration menu
    Copy the full SHA
    6dfed7e View commit details
    Browse the repository at this point in the history
  6. NLL: Broad rewrite of check_access_perimssions.

    Tried to unify various common code paths and also vaguely approximate
    the AST-borrowck diagnostics.
    
    The change in (subjective) quality of diagnostics is not a universal
    improvement. But I think this is a better code base to work from
    for future fixes.
    pnkfelix committed Jun 19, 2018
    Configuration menu
    Copy the full SHA
    7fd4b52 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2d4df5b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    620a853 View commit details
    Browse the repository at this point in the history
  9. Added diagnostics for suggesting mut x on repeated mutations of x.

    (Follow-on commits updating the test suite show the resulting changes
    to diagnostic output.)
    pnkfelix committed Jun 19, 2018
    Configuration menu
    Copy the full SHA
    0d9998c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    35971cc View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a32fca7 View commit details
    Browse the repository at this point in the history
  12. Add unit test for case that didn't seem to be covered in existing UI …

    …tests
    
    (since I made this mistake at first but the tests didn't catch it):
    we should not suggest adding `mut` to a reassigned `ref` or `ref mut` binding.
    
    (The Rust language, since at least 1.0, does not have `mut ref mut` or
    `ref mut mut` etc.)
    pnkfelix committed Jun 19, 2018
    Configuration menu
    Copy the full SHA
    4684649 View commit details
    Browse the repository at this point in the history