about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-06 22:38:33 +0100
committerGitHub <noreply@github.com>2020-02-06 22:38:33 +0100
commit2d8f6389d09bfbaa9a5960c63f6639ddc513c813 (patch)
tree3ce2a1d693e31d97746c05ea716a045c84747d3a /src/librustc_error_codes/error_codes
parent26c86a6a2828b1048fa2fd425595ef8fb475249a (diff)
parent9d7b214ac6cb50a1b5454e0ae904a6479b54261c (diff)
Rollup merge of #68524 - jonas-schievink:generator-resume-arguments, r=Zoxc
Generator Resume Arguments

cc https://github.com/rust-lang/rust/issues/43122 and https://github.com/rust-lang/rust/issues/56974

Blockers:
* [x] Fix miscompilation when resume argument is live across a yield point (https://github.com/rust-lang/rust/pull/68524#issuecomment-578459069)
* [x] Fix 10% compile time regression in `await-call-tree` benchmarks (https://github.com/rust-lang/rust/pull/68524#issuecomment-578487162)
  * [x] Fix remaining 1-3% regression (https://github.com/rust-lang/rust/pull/68524#issuecomment-579566255) - resolved (https://github.com/rust-lang/rust/pull/68524#issuecomment-581144901)
* [x] Make dropck rules account for resume arguments (https://github.com/rust-lang/rust/pull/68524#issuecomment-578541137)

Follow-up work:
* Change async/await desugaring to make use of this feature
* Rewrite [`box_region.rs`](https://github.com/rust-lang/rust/blob/3d8778d767f0dde6fe2bc9459f21ead8e124d8cb/src/librustc_data_structures/box_region.rs) to use resume arguments (this shows up in profiles too)
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0626.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_error_codes/error_codes/E0626.md b/src/librustc_error_codes/error_codes/E0626.md
index db50bd7ac4f..cc6e03d1ca7 100644
--- a/src/librustc_error_codes/error_codes/E0626.md
+++ b/src/librustc_error_codes/error_codes/E0626.md
@@ -12,7 +12,7 @@ let mut b = || {
     yield (); // ...is still in scope here, when the yield occurs.
     println!("{}", a);
 };
-Pin::new(&mut b).resume();
+Pin::new(&mut b).resume(());
 ```
 
 At present, it is not permitted to have a yield that occurs while a
@@ -31,7 +31,7 @@ let mut b = || {
     yield ();
     println!("{}", a);
 };
-Pin::new(&mut b).resume();
+Pin::new(&mut b).resume(());
 ```
 
 This is a very simple case, of course. In more complex cases, we may
@@ -50,7 +50,7 @@ let mut b = || {
     yield x; // ...when this yield occurs.
   }
 };
-Pin::new(&mut b).resume();
+Pin::new(&mut b).resume(());
 ```
 
 Such cases can sometimes be resolved by iterating "by value" (or using
@@ -66,7 +66,7 @@ let mut b = || {
     yield x; // <-- Now yield is OK.
   }
 };
-Pin::new(&mut b).resume();
+Pin::new(&mut b).resume(());
 ```
 
 If taking ownership is not an option, using indices can work too:
@@ -83,7 +83,7 @@ let mut b = || {
     yield x; // <-- Now yield is OK.
   }
 };
-Pin::new(&mut b).resume();
+Pin::new(&mut b).resume(());
 
 // (*) -- Unfortunately, these temporaries are currently required.
 // See <https://github.com/rust-lang/rust/issues/43122>.