Skip to content

NLL: turn off migration mode #58781

Closed

Description

@pnkfelix

Transition fully to NLL (instead of the migration mode currently used).

Activity

  1. pnkfelix commented on Feb 27, 2019

    @pnkfelix
    ContributorAuthor

    Explicitly marking this P-medium for now, to reflect the fact that transitioning the 2015 edition to migrate mode is higher priority for the short term.

  2. added
    A-NLLArea: Non-lexical lifetimes (NLL)
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Feb 27, 2019
  3. added 3 commits that reference this issue on Apr 22, 2019
  4. nikomatsakis commented on May 9, 2019

    @nikomatsakis
    Contributor

    Created #60680 as an issue to do a first crater run to get a rough idea.

  5. jethrogb commented on May 10, 2019

    @jethrogb
    Contributor

    Is this the right place for comments/questions about the migration warning?

    I got this warning:

       = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
       = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
    

    The warning is good, my code definitely has UB. I found that I can't upgrade the warning to an error with deny/forbid(warnings). Why is that?

    This code compiles and has UB on Rust 1.0, I thought NLL is only supposed to relax things? Are you still fixing any bugs in the old borrow checker?

  6. pnkfelix commented on May 13, 2019

    @pnkfelix
    ContributorAuthor

    @jethrogb no, NLL was not meant to solely relax things. Such relaxation is the primary selling point of NLL, but we always knew it was going to introduce breakage.

    The shift to NLL is coupled with a change in the underlying borrow-checker implementation to analyze MIR (instead of analyzing the higher-level AST, which is what the old borrow checker did). In order to avoid injecting breaking changes that people could not work around in the short term, we currently have NLL in a migration mode. That was added in PR #52681.

    In hindsight, it may have been nice to leverage the lint system here to let people upgrade these warnings to errors. (One reason we didn't do that is that we didn't want people to #![allow(..)] the warnings here. For more on that, see also issue #34596 and PR #59658.)

  7. added 2 commits that reference this issue on Aug 6, 2019
  8. 18 remaining items

  9. lqd commented on Jun 23, 2021

    @lqd
    Member

    Sorry, I meant I had already rebased your branch in the link above: it was indeed in slow-moving parts of the compiler, with only a few simple conflicts, and only one compile error. Very straightforward to update overall.

    Your improvements to these error messages are already looking great. I can open a PR and help land them, if @nikomatsakis and @Aaron1011 want to have a look ?

  10. Aaron1011 commented on Oct 2, 2021

    @Aaron1011
    Contributor

    Now that higher-ranked subtype errors are improved for stable code (#57374 (comment)), is #73154 the only blocker?

  11. lqd commented on Oct 2, 2021

    @lqd
    Member

    A few ideas:

    • maybe the couple needed cleanups that we mentioned before. I had started deduplicating the normalize query in the HRTB diagnostic code and the changes are not what I expected at first (there's no failure to normalize, even though that's what the fallback error message says when the nice errors can't be emitted). It looks more like changes only impacting what this test checks with the leak check turned off.
    • which reminds me, do we need to have a plan about the leak check, if we want to turn NLLs on ?
    • just checking: even though it's still marked as potential blocker in some tracking issues, it seems that we don't need to do anything about the 2PB situation and the mutable_borrow_reservation_conflict lint from Tracking issue for mutable_borrow_reservation_conflict compatibility lint #59159 to turn NLLs on ?
    • we should take another look at the NLL diagnostics: both checking the existing 225 blessed NLL test expectations, and triage the 17 open NLL-Diagnostics issues, to see if they match the non-NLL diagnostics in quality and clarity.
  12. nikomatsakis commented on Oct 4, 2021

    @nikomatsakis
    Contributor

    Regarding the leak check:

    I believe we do have to reproduce some of that functionality.

  13. marmeladema commented on Mar 31, 2022

    @marmeladema
    Contributor

    Is there something actionable that a small contributor like me could help with? It would be very pleasant to finally stabilize NLL 🥳

  14. bstrie commented on Mar 31, 2022

    @bstrie
    Contributor

    @marmeladema The diagnostic issues mentioned above could probably use triage to see if they're still relevant: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3ANLL-diagnostics . If they are, then resolving those may be a good place to start. You can also try hopping into #t-compiler or #t-compiler/help and asking there.

  15. marmeladema commented on Apr 1, 2022

    @marmeladema
    Contributor

    I opened a zulip threads in the wg-nll group about those: https://rust-lang.zulipchat.com/#narrow/stream/122657-t-compiler.2Fwg-nll/topic/nll.20diagnostics.20issues

    TL;DR is that there are actually 4 and we believe they can all probably be closed.

  16. jackh726 commented on May 5, 2022

    @jackh726
    Member

    I've updated the op to include the latest potential blockers and added a tracking label to reflect that some impl work needs to be re. #73154.

  17. m-ou-se commented on May 17, 2022

    @m-ou-se
    Member

    Do we know why turning off migration mode fixes #95527?

    Is that something that can be fixed without having to wait for turning off migration mode (to not block scoped threads on #73154)?

  18. jackh726 commented on May 17, 2022

    @jackh726
    Member

    I'm not sure. Let's see if I can take a decent stab at #73154 before trying to dig into #95527. (It's likely that any fix for #95527 will be just as complex (if not more) than just fixing #73154)

  19. added a commit that references this issue on Jun 16, 2022
    34f2839
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCP-mediumMedium priorityS-tracking-impl-incompleteStatus: The implementation is incomplete.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions