#![allow(dead_code, deprecated, unused_variables, unused_mut)] use std::ffi::{CStr, FromBytesWithNulError}; fn main() { let cstr = CStr::from_bytes_with_nul(b"hello"); assert_eq!(cstr, Err(FromBytesWithNulError::NotNulTerminated)); }