-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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] bootstrap rustc with NLL enabled #51823
Comments
Here's a summary of this adventure :) I'll ignore the cases where MIR borrowck correctly adds new "unused mut" lint warnings which were previously not found by the AST borrowck: while they are new warnings, the unused muts were easily removed from the rustc code in order to keep building, so I marked them as ok (but can produce the list of cases if need be). I tested by manually enabling the NLL feature in crates, Interesting cases
Cases of incorrect "unused mut" lint warnings
Crates without issues
|
Tagging this meta bug as NLL-deferred until the following issues are fixed: |
Now that all of those issues are fixed, I've added #52671 to the list since it is also blocking bootstrap. With that fix bootstrapping still breaks due to the unused mut lint and a case where two phase borrows don't track activation through unsized coercions. I've created PRs for those. |
[NLL] Fix some things for bootstrap Some changes that are required when bootstrapping rustc with NLL enabled. * Remove a bunch of unused `mut`s that aren't needed, but the existing lint doesn't catch. * Rewrite a function call to satisfy NLL borrowck. Note that the borrow is two-phase, but gets activated immediately by an unsizing coercion. cc #51823
…r=pnkfelix [NLL] Allow conflicting borrows of promoted length zero arrays This is currently overkill as there's no way to create two conflicting borrows of any promoted. It is possible that the following code might not fail due to const eval in the future (@oli-obk?). In which case either the array marked needs to not be promoted, or to be checked for conflicts ```rust static mut A: () = { let mut y = None; let z; let mut done_y = false; loop { let x = &mut [1]; // < this array if done_y { z = x; break; } y = Some(x); done_y = true; } some_const_fn(y, z); // some_const_fn expects that y to not alias z. }; ``` r? @pnkfelix @nikomatsakis closes rust-lang#52671 cc rust-lang#51823
Ok so rustc almost bootstraps, but changes since my last comment prevent it from doing so (more unused mut that AST misses, an issue with incorrect lifetime annotations). At this point I think that this will have to be checked with CI. @Mark-Simulacrum @nikomatsakis @pnkfelix was there a decision on how we want to move rustc/CI towards nll? |
I sort of presume that we can enable -Zborrowck=mir across all compilations in rust-lang/rust as soon as we believe the performance is good enough and the compiler works with it. |
Or at least |
Although, what am I talking about, we control our own code, we don't need to use the migration path. |
Closing in favor of #53172 |
As discussed in today's meeting, we need to get rustc bootstrapping with NLL enabled -- if there are problems, we should isolate them.
@lqd is going to try and push this through and report back.
The text was updated successfully, but these errors were encountered: