Guest User

Untitled

a guest
Aug 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #![feature(nll)]
  2. #![allow(dead_code)]
  3.  
  4. struct S<'a> {
  5. value: &'a Value,
  6. }
  7.  
  8. struct Value {
  9. data: u32,
  10. }
  11.  
  12. impl<'a> S<'a> {
  13. fn get(&self) -> Result<&'a mut Value, String> {
  14. unimplemented!();
  15. }
  16.  
  17. fn at(&self) {
  18. let v = self.get();
  19. if let Ok(Value { ref mut data }) = v {
  20. let _res : &u32 = data;
  21. }
  22. }
  23. }
  24.  
  25. fn main() {
  26. }
Add Comment
Please, Sign In to add comment