Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- let a = [1u8, 2, 3]; let b = &a[4..];
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- warning: unused variable: `b`
- --> src/main.rs:6:34
- |
- 6 | let a = [1u8, 2, 3]; let b = &a[4..];
- | ^ help: consider prefixing with an underscore: `_b`
- |
- = note: #[warn(unused_variables)] on by default
- Finished dev [unoptimized + debuginfo] target(s) in 0.69s
- Running `target/debug/playground`
- thread 'main' panicked at 'slice index starts at 4 but ends at 3', src/libcore/slice/mod.rs:2419:5
- note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement