Guest User

Untitled

a guest
May 26th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #![feature(thread_local, const_vec_new, nll)]
  2.  
  3. fn main() {
  4. println!("{:?}", {
  5. #[thread_local] static mut VEC: Vec<u8> = Vec::new(); unsafe { VEC.push(1); VEC[0] }
  6. });
  7. }
  8.  
  9.  
  10. /* ~~~~=== stderr ===~~~~
  11. Compiling playground v0.0.1 (file:///playground)
  12. error: `<std::vec::Vec<T>>::new` is not yet stable as a const fn
  13. --> src/main.rs:5:52
  14. |
  15. 5 | #[thread_local] static mut VEC: Vec<u8> = Vec::new(); unsafe { VEC.push(1); VEC }
  16. | ^^^^^^^^^^
  17. |
  18. = help: in Nightly builds, add `#![feature(const_vec_new)]` to the crate attributes to enable
  19.  
  20. error: aborting due to previous error
  21.  
  22. error: Could not compile `playground`.
  23.  
  24. To learn more, run the command again with --verbose.
  25.  
  26. */
  27.  
  28. /* ~~~~=== stdout ===~~~~
  29.  
  30. */
Add Comment
Please, Sign In to add comment