SHARE
TWEET

Untitled

a guest Oct 17th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::pin::Pin;
  2.  
  3. struct A {
  4.     a: i32,
  5.     b: i32,
  6. }
  7.  
  8. impl A {
  9.     // fn t(&mut self) {  只要self不是Pin就不会出错
  10.     fn t(&mut self: Pin<&mut Self>) {
  11.         let b_a = &mut self.a;
  12.         Pin::new(&mut self.b);
  13.         *b_a = 10;
  14.     }
  15. }
  16.  
  17. fn main() {}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top