-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #54622 - matthewjasper:more-nll-mode, r=pnkfelix
Enable NLL compare mode for more tests Most of these tests were disabled due to NLL bugs that have since been fixed. A few needed updating for NLL. r? @nikomatsakis
- Loading branch information
Showing
58 changed files
with
458 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0502]: cannot borrow `*v` as mutable because it is also borrowed as immutable | ||
--> $DIR/borrowck-lend-flow-if.rs:39:16 | ||
| | ||
LL | _w = &v; | ||
| -- immutable borrow occurs here | ||
LL | } | ||
LL | borrow_mut(&mut *v); //~ ERROR cannot borrow | ||
| ^^^^^^^ mutable borrow occurs here | ||
LL | _w.use_ref(); | ||
| -- borrow later used here | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0502`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0502]: cannot borrow `*v` as mutable because it is also borrowed as immutable | ||
--> $DIR/borrowck-lend-flow.rs:34:16 | ||
| | ||
LL | let _w = &v; | ||
| -- immutable borrow occurs here | ||
LL | borrow_mut(&mut *v); //~ ERROR cannot borrow | ||
| ^^^^^^^ mutable borrow occurs here | ||
LL | _w.use_ref(); | ||
| -- borrow later used here | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0502`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/test/ui/regions/regions-bounded-by-trait-requiring-static.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-bounded-by-trait-requiring-static.rs:32:5 | ||
| | ||
LL | fn param_not_ok<'a>(x: &'a isize) { | ||
| -- lifetime `'a` defined here | ||
LL | assert_send::<&'a isize>(); //~ ERROR does not fulfill the required lifetime | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` | ||
|
||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-bounded-by-trait-requiring-static.rs:36:5 | ||
| | ||
LL | fn param_not_ok1<'a>(_: &'a isize) { | ||
| -- lifetime `'a` defined here | ||
LL | assert_send::<&'a str>(); //~ ERROR does not fulfill the required lifetime | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` | ||
|
||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-bounded-by-trait-requiring-static.rs:40:5 | ||
| | ||
LL | fn param_not_ok2<'a>(_: &'a isize) { | ||
| -- lifetime `'a` defined here | ||
LL | assert_send::<&'a [isize]>(); //~ ERROR does not fulfill the required lifetime | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` | ||
|
||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-bounded-by-trait-requiring-static.rs:54:5 | ||
| | ||
LL | fn box_with_region_not_ok<'a>() { | ||
| -- lifetime `'a` defined here | ||
LL | assert_send::<Box<&'a isize>>(); //~ ERROR does not fulfill the required lifetime | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` | ||
|
||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-bounded-by-trait-requiring-static.rs:65:5 | ||
| | ||
LL | fn unsafe_ok2<'a>(_: &'a isize) { | ||
| -- lifetime `'a` defined here | ||
LL | assert_send::<*const &'a isize>(); //~ ERROR does not fulfill the required lifetime | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` | ||
|
||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-bounded-by-trait-requiring-static.rs:69:5 | ||
| | ||
LL | fn unsafe_ok3<'a>(_: &'a isize) { | ||
| -- lifetime `'a` defined here | ||
LL | assert_send::<*mut &'a isize>(); //~ ERROR does not fulfill the required lifetime | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` | ||
|
||
error: aborting due to 6 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/test/ui/regions/regions-bounded-method-type-parameters.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0621]: explicit lifetime required in the type of `x` | ||
--> $DIR/regions-bounded-method-type-parameters.rs:22:5 | ||
| | ||
LL | fn caller<'a>(x: &isize) { | ||
| ------ help: add explicit lifetime `'a` to the type of `x`: `&'a isize` | ||
LL | Foo.some_method::<&'a isize>(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required | ||
|
||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-bounded-method-type-parameters.rs:22:5 | ||
| | ||
LL | fn caller<'a>(x: &isize) { | ||
| -- lifetime `'a` defined here | ||
LL | Foo.some_method::<&'a isize>(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0621`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/ui/regions/regions-bounded-method-type-parameters.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/ui/regions/regions-infer-contravariance-due-to-decl.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-infer-contravariance-due-to-decl.rs:35:9 | ||
| | ||
LL | fn use_<'short,'long>(c: Contravariant<'short>, | ||
| ------ ----- lifetime `'long` defined here | ||
| | | ||
| lifetime `'short` defined here | ||
... | ||
LL | let _: Contravariant<'long> = c; //~ ERROR E0623 | ||
| ^ type annotation requires that `'short` must outlive `'long` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/ui/regions/regions-infer-covariance-due-to-decl.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: unsatisfied lifetime constraints | ||
--> $DIR/regions-infer-covariance-due-to-decl.rs:32:9 | ||
| | ||
LL | fn use_<'short,'long>(c: Covariant<'long>, | ||
| ------ ----- lifetime `'long` defined here | ||
| | | ||
| lifetime `'short` defined here | ||
... | ||
LL | let _: Covariant<'short> = c; //~ ERROR E0623 | ||
| ^ type annotation requires that `'short` must outlive `'long` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.