<!-- Thank you for filing a bug report! 🐛 Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. --> I tried this code: ```rust use std::ffi::CStr; pub fn bytes(a: &CStr) -> bool { a.to_bytes() == b".." } pub fn cstr(a: &CStr) -> bool { a == unsafe { CStr::from_bytes_with_nul_unchecked(b"..\0") } } ``` Godbolt: https://rust.godbolt.org/z/nh6nGjPMP The explicit conversion to bytes lets the compiler figure out that it can compare two integers, but directly comparing CStrs seems to block that.