SHARE
TWEET

Untitled

a guest Aug 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5.     println!("{:?}", {
  6.         use std::io::Write; let mut v = vec![0_u8; 3]; { let mut buf = &mut *v; write!(buf, "{}", "abcd").unwrap(); } v
  7.     });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12.    Compiling playground v0.0.1 (/playground)
  13.     Finished dev [unoptimized + debuginfo] target(s) in 2.08s
  14.      Running `target/debug/playground`
  15. thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: WriteZero, error: StringError("failed to write whole buffer") }', src/libcore/result.rs:999:5
  16. note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
  17.  
  18. */
  19.  
  20. /* ~~~~=== stdout ===~~~~
  21.  
  22. */
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