1 //! This test ensures that a mutable reference cannot be passed as a resume argument twice.
3 #![feature(generators, generator_trait)]
5 use std::marker::Unpin;
8 GeneratorState::{self, *},
13 let mut thing = String::from("hello");
21 let mut gen = Pin::new(&mut gen);
22 gen.as_mut().resume(&mut thing);
23 gen.as_mut().resume(&mut thing);
24 //~^ cannot borrow `thing` as mutable more than once at a time