add an undef validation test
This commit is contained in:
parent
8509dbbafe
commit
bc240ff606
14
tests/compile-fail/validation_undef.rs
Normal file
14
tests/compile-fail/validation_undef.rs
Normal 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();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user