1 error: using `libc::strlen` on a `CString` or `CStr` value
2 --> $DIR/strlen_on_c_strings.rs:15:13
4 LL | let _ = unsafe { libc::strlen(cstring.as_ptr()) };
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstring.as_bytes().len()`
7 = note: `-D clippy::strlen-on-c-strings` implied by `-D warnings`
9 error: using `libc::strlen` on a `CString` or `CStr` value
10 --> $DIR/strlen_on_c_strings.rs:19:13
12 LL | let _ = unsafe { libc::strlen(cstr.as_ptr()) };
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstr.to_bytes().len()`
15 error: using `libc::strlen` on a `CString` or `CStr` value
16 --> $DIR/strlen_on_c_strings.rs:21:13
18 LL | let _ = unsafe { strlen(cstr.as_ptr()) };
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstr.to_bytes().len()`
21 error: using `libc::strlen` on a `CString` or `CStr` value
22 --> $DIR/strlen_on_c_strings.rs:24:22
24 LL | let _ = unsafe { strlen((*pcstr).as_ptr()) };
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `(*pcstr).to_bytes().len()`
27 error: using `libc::strlen` on a `CString` or `CStr` value
28 --> $DIR/strlen_on_c_strings.rs:29:22
30 LL | let _ = unsafe { strlen(unsafe_identity(cstr).as_ptr()) };
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unsafe_identity(cstr).to_bytes().len()`
33 error: using `libc::strlen` on a `CString` or `CStr` value
34 --> $DIR/strlen_on_c_strings.rs:30:13
36 LL | let _ = unsafe { strlen(unsafe { unsafe_identity(cstr) }.as_ptr()) };
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unsafe { unsafe_identity(cstr) }.to_bytes().len()`
39 error: using `libc::strlen` on a `CString` or `CStr` value
40 --> $DIR/strlen_on_c_strings.rs:33:22
42 LL | let _ = unsafe { strlen(f(cstr).as_ptr()) };
43 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `f(cstr).to_bytes().len()`
45 error: aborting due to 7 previous errors