Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- use std::io::Write; let mut v = vec![0_u8; 3]; { let mut buf = &mut *v; write!(buf, "{}", "abcd").unwrap(); } v
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- Finished dev [unoptimized + debuginfo] target(s) in 2.08s
- Running `target/debug/playground`
- 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
- note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement