daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Dec 7th, 2018 55 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5.     println!("{:?}", {
  6.         let n = 2; (0..n).flat_map(|x| (0..n).map(|m| (x, m))).collect::<Vec<_>>() // that move is necessary, right?
  7.     });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12.    Compiling playground v0.0.1 (/playground)
  13. error[E0597]: `x` does not live long enough
  14.  --> src/main.rs:6:56
  15.   |
  16. 6 |         let n = 2; (0..n).flat_map(|x| (0..n).map(|m| (x, m))).collect::<Vec<_>>() // that move is necessary, right?
  17.   |                                                   ---  ^    -                    - borrowed value needs to live until here
  18.   |                                                   |    |    |
  19.   |                                                   |    |    borrowed value only lives until here
  20.   |                                                   |    borrowed value does not live long enough
  21.   |                                                   capture occurs here
  22.  
  23. error: aborting due to previous error
  24.  
  25. For more information about this error, try `rustc --explain E0597`.
  26. error: Could not compile `playground`.
  27.  
  28. To learn more, run the command again with --verbose.
  29.  
  30. */
  31.  
  32. /* ~~~~=== stdout ===~~~~
  33.  
  34. */
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