Rollup merge of #80629 - sexxi-goose:migrations_1, r=nikomatsakis

Add lint for 2229 migrations

Implements the first for RFC 2229 where we make the decision to migrate a root variable based on if the type of the variable needs Drop and if the root variable would be moved into the closure when the feature isn't enabled.

r? `@nikomatsakis`
This commit is contained in:
Jonas Schievink 2021-02-02 12:14:44 +01:00 committed by GitHub
commit a1887912e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 812 additions and 53 deletions

View file

@ -7,10 +7,10 @@ LL | let mut closure1 = || p = &y;
= note: defining type: test::{closure#0}::{closure#0} with closure substs [
i16,
extern "rust-call" fn(()),
(&'_#1r i32, &'_#2r mut &'_#3r i32),
(&'_#1r mut &'_#2r i32, &'_#3r i32),
]
= note: number of external vids: 4
= note: where '_#1r: '_#3r
= note: where '_#3r: '_#2r
note: external requirements
--> $DIR/escape-upvar-nested.rs:20:27
@ -25,10 +25,10 @@ LL | | };
= note: defining type: test::{closure#0} with closure substs [
i16,
extern "rust-call" fn(()),
(&'_#1r i32, &'_#2r mut &'_#3r i32),
(&'_#1r mut &'_#2r i32, &'_#3r i32),
]
= note: number of external vids: 4
= note: where '_#1r: '_#3r
= note: where '_#3r: '_#2r
note: no external requirements
--> $DIR/escape-upvar-nested.rs:13:1

View file

@ -7,10 +7,10 @@ LL | let mut closure = || p = &y;
= note: defining type: test::{closure#0} with closure substs [
i16,
extern "rust-call" fn(()),
(&'_#1r i32, &'_#2r mut &'_#3r i32),
(&'_#1r mut &'_#2r i32, &'_#3r i32),
]
= note: number of external vids: 4
= note: where '_#1r: '_#3r
= note: where '_#3r: '_#2r
note: no external requirements
--> $DIR/escape-upvar-ref.rs:17:1