diff --git a/rust-version b/rust-version index 452bb5c2b97f..0c7f46922122 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -nightly-2019-01-28 +nightly-2019-01-30 diff --git a/tests/run-pass/generator.rs b/tests/run-pass/generator.rs index 603093a037c7..c9c114aaccca 100644 --- a/tests/run-pass/generator.rs +++ b/tests/run-pass/generator.rs @@ -11,12 +11,15 @@ #![feature(generators, generator_trait)] use std::ops::{GeneratorState, Generator}; +use std::pin::Pin; fn finish(mut amt: usize, mut t: T) -> T::Return where T: Generator { + // We are not moving the `t` around until it gets dropped, so this is okay. + let mut t = unsafe { Pin::new_unchecked(&mut t) }; loop { - match unsafe { t.resume() } { + match t.as_mut().resume() { GeneratorState::Yielded(y) => amt -= y, GeneratorState::Complete(ret) => { assert_eq!(amt, 0);