mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
add an undef validation test
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#![allow(unused_variables)]
|
||||
// error-pattern: attempted to read undefined bytes
|
||||
|
||||
mod safe {
|
||||
use std::mem;
|
||||
|
||||
pub(crate) fn make_float() -> f32 {
|
||||
unsafe { mem::uninitialized() }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _x = safe::make_float();
|
||||
}
|
||||
Reference in New Issue
Block a user