From 044fe0f558aa62926e6de9a76b95e4a74c0b1f99 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sat, 25 Jan 2020 20:03:10 +0100 Subject: Add a resume type parameter to `Generator` --- src/librustc_error_codes/error_codes/E0626.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/librustc_error_codes/error_codes') 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 . -- cgit 1.4.1-3-g733a5