A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rust-lang/rust/issues/53566 below:

vec_deque::Iter has unsound Debug implementation · Issue #53566 · rust-lang/rust · GitHub

Found by @MaloJaffre: The following code causes UB (not observable through crashes, but still):

use std::collections::VecDeque;
fn main() {
    println!("{:?}", VecDeque::<u32>::new().iter());
}

This will create a VecDeque ring with capacity 8, then turn that into a slice for Iter, and then print that entire slice. Run it in Miri to see for yourself (Miri is in the "tools" menu).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4