about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs8
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!() }
     }