diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2021-05-31 16:33:09 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2021-06-08 19:24:16 +0200 |
| commit | ecc68e78799968d719e38c0fc5bf80e2d9800953 (patch) | |
| tree | d19a47bce843fbaf1ffbda72516b95d9c91671bb | |
| parent | bddf151deac83ad9306c31806ebacfede93e4b99 (diff) | |
| download | rust-ecc68e78799968d719e38c0fc5bf80e2d9800953.tar.gz rust-ecc68e78799968d719e38c0fc5bf80e2d9800953.zip | |
Replace Pin::new with .as_mut()
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 8f6c955056d..e888af97dc1 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -140,7 +140,7 @@ impl BoxedResolver { let mut generator = Box::pin(generator); // Run it to the first yield to set it up - let init = match Pin::new(&mut generator).resume(Action::Initial) { + let init = match generator.as_mut().resume(Action::Initial) { GeneratorState::Yielded(YieldType::Initial(y)) => y, _ => panic!(), }; @@ -162,7 +162,9 @@ impl BoxedResolver { // Get the generator to call our closure unsafe { // Call the generator, which in turn will call the closure - if let GeneratorState::Complete(_) = Pin::new(&mut self.generator) + if let GeneratorState::Complete(_) = self + .generator + .as_mut() .resume(Action::Access(AccessAction(::std::mem::transmute(mut_f)))) { panic!() @@ -175,7 +177,7 @@ impl BoxedResolver { pub fn complete(mut self) -> ResolverOutputs { // Tell the generator we want it to complete, consuming it and yielding a result - let result = Pin::new(&mut self.generator).resume(Action::Complete); + let result = self.generator.as_mut().resume(Action::Complete); if let GeneratorState::Complete(r) = result { r } else { panic!() } } |
