]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakis
authorbors <bors@rust-lang.org>
Fri, 27 Jul 2018 09:10:07 +0000 (09:10 +0000)
committerbors <bors@rust-lang.org>
Fri, 27 Jul 2018 09:10:07 +0000 (09:10 +0000)
Add `-Z borrowck=migrate`

This adds `-Z borrowck=migrate`, which represents the way we want to migrate to NLL under Rust versions to come. It also hooks this new mode into `--edition 2018`, which means we're officially turning NLL on in the 2018 edition.

The basic idea of `-Z borrowck=migrate` that there are cases where NLL is fixing old soundness bugs in the borrow-checker, but in order to avoid just breaking code by immediately rejecting the programs that hit those soundness bugs, we instead use the following strategy:

If your code is accepted by NLL, then we accept it.
If your code is rejected by both NLL and the old AST-borrowck, then we reject it.
If your code is rejected by NLL but accepted by the old AST-borrowck, then we emit the new NLL errors as **warnings**.

These warnings will be turned into hard errors in the future, and they say so in these diagnostics.

Fix #46908


No differences found