Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(thread_local, const_vec_new, nll)]
- fn main() {
- println!("{:?}", {
- #[thread_local] static mut VEC: Vec<u8> = Vec::new(); unsafe { VEC.push(1); VEC[0] }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error: `<std::vec::Vec<T>>::new` is not yet stable as a const fn
- --> src/main.rs:5:52
- |
- 5 | #[thread_local] static mut VEC: Vec<u8> = Vec::new(); unsafe { VEC.push(1); VEC }
- | ^^^^^^^^^^
- |
- = help: in Nightly builds, add `#![feature(const_vec_new)]` to the crate attributes to enable
- error: aborting due to previous error
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment