File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
tests/ui/associated-types Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -710,6 +710,14 @@ impl AsRef<CStr> for CStr {
710710 }
711711}
712712
713+ impl ops:: Deref for CStr {
714+ type Target = crate :: bstr:: ByteStr ;
715+
716+ fn deref ( & self ) -> & Self :: Target {
717+ crate :: bstr:: ByteStr :: from_bytes ( self . to_bytes ( ) )
718+ }
719+ }
720+
713721/// Calculate the length of a nul-terminated string. Defers to C's `strlen` when possible.
714722///
715723/// # Safety
Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ LL - type X = std::ops::Deref::Target;
4949LL + type X = <ByteString as Deref>::Target;
5050 |
5151LL - type X = std::ops::Deref::Target;
52- LL + type X = <CString as Deref>::Target;
52+ LL + type X = <CStr as Deref>::Target;
5353 |
5454LL - type X = std::ops::Deref::Target;
55- LL + type X = <IoSlice<'_> as Deref>::Target;
55+ LL + type X = <CString as Deref>::Target;
5656 |
5757 and N other candidates
5858
You can’t perform that action at this time.
0 commit comments