add an undef validation test

This commit is contained in:
Ralf Jung 2017-09-16 12:11:48 +02:00
parent 8509dbbafe
commit bc240ff606

View File

@ -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();
}