third_party_rust_cxx/tests/unique_ptr.rs

9 lines
221 B
Rust
Raw Normal View History

2020-04-10 06:44:23 +00:00
use cxx::{CxxString, UniquePtr};
#[test]
#[should_panic = "called deref on a null UniquePtr<CxxString>"]
fn test_deref_null() {
let unique_ptr = UniquePtr::<CxxString>::null();
let _: &CxxString = &unique_ptr;
}