]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/strlen_on_c_strings.stderr
Auto merge of #97944 - nikic:freebsd-update, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / strlen_on_c_strings.stderr
1 error: using `libc::strlen` on a `CString` or `CStr` value
2   --> $DIR/strlen_on_c_strings.rs:15:13
3    |
4 LL |     let _ = unsafe { libc::strlen(cstring.as_ptr()) };
5    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstring.as_bytes().len()`
6    |
7    = note: `-D clippy::strlen-on-c-strings` implied by `-D warnings`
8
9 error: using `libc::strlen` on a `CString` or `CStr` value
10   --> $DIR/strlen_on_c_strings.rs:19:13
11    |
12 LL |     let _ = unsafe { libc::strlen(cstr.as_ptr()) };
13    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstr.to_bytes().len()`
14
15 error: using `libc::strlen` on a `CString` or `CStr` value
16   --> $DIR/strlen_on_c_strings.rs:21:13
17    |
18 LL |     let _ = unsafe { strlen(cstr.as_ptr()) };
19    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstr.to_bytes().len()`
20
21 error: using `libc::strlen` on a `CString` or `CStr` value
22   --> $DIR/strlen_on_c_strings.rs:24:22
23    |
24 LL |     let _ = unsafe { strlen((*pcstr).as_ptr()) };
25    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `(*pcstr).to_bytes().len()`
26
27 error: using `libc::strlen` on a `CString` or `CStr` value
28   --> $DIR/strlen_on_c_strings.rs:29:22
29    |
30 LL |     let _ = unsafe { strlen(unsafe_identity(cstr).as_ptr()) };
31    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unsafe_identity(cstr).to_bytes().len()`
32
33 error: using `libc::strlen` on a `CString` or `CStr` value
34   --> $DIR/strlen_on_c_strings.rs:30:13
35    |
36 LL |     let _ = unsafe { strlen(unsafe { unsafe_identity(cstr) }.as_ptr()) };
37    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unsafe { unsafe_identity(cstr) }.to_bytes().len()`
38
39 error: using `libc::strlen` on a `CString` or `CStr` value
40   --> $DIR/strlen_on_c_strings.rs:33:22
41    |
42 LL |     let _ = unsafe { strlen(f(cstr).as_ptr()) };
43    |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `f(cstr).to_bytes().len()`
44
45 error: aborting due to 7 previous errors
46