-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #35732 - jonathandturner:region_error_labels, r=nikomat…
…sakis Move 'doesn't live long enough' errors to labels This patch moves the "doesn't live long enough" region-style errors to instead use labels. An example follows. Before: ``` error: `x` does not live long enough --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:26:18 | 26 | let y = &x; | ^ | note: reference must be valid for the block at 23:10... --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:23:11 | 23 | fn main() { | ^ note: ...but borrowed value is only valid for the block suffix following statement 0 at 25:18 --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:25:19 | 25 | let x = 1; | ^ ``` After: ``` error: `x` does not live long enough --> src/test/compile-fail/send-is-not-static-ensures-scoping.rs:26:18 | 26 | let y = &x; | ^ does not live long enough ... 32 | }; | - borrowed value only valid until here ... 35 | } | - borrowed value must be valid until here ``` r? @nikomatsakis
- Loading branch information
Showing
10 changed files
with
129 additions
and
44 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
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
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
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: `x` does not live long enough | ||
--> $DIR/issue-11925.rs:18:36 | ||
| | ||
18 | let f = to_fn_once(move|| &x); | ||
| ^ | ||
| | | ||
| does not live long enough | ||
| borrowed value only valid until here | ||
... | ||
23 | } | ||
| - borrowed value must be valid until here | ||
|
||
error: aborting due to previous error | ||
|