]> git.proxmox.com Git - rustc.git/blame - vendor/cstr/tests/clippy_lints.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / vendor / cstr / tests / clippy_lints.rs
CommitLineData
6a06907d
XL
1use cstr::cstr;
2use std::ffi::CStr;
3
4#[test]
5#[deny(clippy::transmute_ptr_to_ref)]
6fn deny_transmute_ptr_to_ref() {
7 let s: &'static CStr = cstr!("foo\u{4e00}bar");
8 let expected = b"foo\xe4\xb8\x80bar\0";
9 assert_eq!(s, CStr::from_bytes_with_nul(expected).unwrap());
10}