Skip to content

[nll] bootstrap rustc with NLL enabled #51823

Closed

Description

@nikomatsakis

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.

Activity

  1. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    NLL-completeWorking towards the "valid code works" goal
    on Jun 26, 2018
  2. self-assigned this
    on Jun 26, 2018
  3. lqd commented on Jun 29, 2018

    @lqd
    Member

    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, #![cfg_attr(not(stage0), feature(nll))], and building. This doesn't test the submodules, stdsimd, and tools.

    Interesting cases

    Cases of incorrect "unused mut" lint warnings

    Crates without issues
    • liballoc_jemalloc: seems ok (unsure whether it's built when jemalloc is disabled in the config.toml)
    • liballoc_system: seems ok
    • libarena: ok
    • libfmt_macros: ok
    • libgraphviz: ok
    • libpanic_abort: ok
    • libpanic_unwind: ok
    • libproc_macro: ok
    • libprofiler_builtins: ok
    • librustc_allocator: ok
    • librustc_apfloat: ok
    • librustc_asan: ok
    • librustc_borrowck: ok
    • librustc_codegen_llvm: ok
    • librustc_codegen_utils: ok
    • librustc_cratesio_shim: ok, but it's just 2 extern crates
    • librustc_errors: ok
    • librustc_incremental: ok
    • librustc_llvm: ok
    • librustc_lsan: ok
    • librustc_metadata: ok
    • librustc_mir: used to ICE with region_obligations not empty (known issue region_obligations not empty #51649). Now ok.
    • librustc_msan: ok
    • librustc_platform_intrinsics: ok
    • librustc_plugin: ok
    • librustc_privacy: ok
    • librustc_resolve: ok
    • librustc_save_analysis: ok
    • librustc_target: ok
    • librustc_tsan: ok
    • librustdoc: ok
    • libstd: ok
    • libstd_unicode: the little of what is there is ok :)
    • libsyntax_pos: ok
    • libterm: ok
    • libtest: ok
    • libunwind: ok
    • rustc: if it is built by x.py build, then it is ok.
  4. matthewjasper commented on Jul 29, 2018

    @matthewjasper
    Contributor

    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.

  5. added a commit that references this issue on Jul 30, 2018
  6. added a commit that references this issue on Aug 1, 2018
  7. matthewjasper commented on Aug 2, 2018

    @matthewjasper
    Contributor

    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?

  8. Mark-Simulacrum commented on Aug 2, 2018

    @Mark-Simulacrum
    Member

    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.

  9. pnkfelix commented on Aug 3, 2018

    @pnkfelix
    Contributor

    Or at least -Z borrowck=migrate -Z two-phase-borrows. I'm not sure about going all the way to -Z borrowck=mir -Z two-phase-borrows in our first step here.

  10. pnkfelix commented on Aug 3, 2018

    @pnkfelix
    Contributor

    Although, what am I talking about, we control our own code, we don't need to use the migration path.

  11. matthewjasper commented on Aug 9, 2018

    @matthewjasper
    Contributor

    Closing in favor of #53172

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

    NLL-completeWorking towards the "valid code works" goalT-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