summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/strlen_on_c_strings.stderr
blob: fcd17f6894040e9629fc7b773129d08f8e67e65e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
error: using `libc::strlen` on a `CString` or `CStr` value
  --> $DIR/strlen_on_c_strings.rs:15:13
   |
LL |     let _ = unsafe { libc::strlen(cstring.as_ptr()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstring.as_bytes().len()`
   |
   = note: `-D clippy::strlen-on-c-strings` implied by `-D warnings`

error: using `libc::strlen` on a `CString` or `CStr` value
  --> $DIR/strlen_on_c_strings.rs:19:13
   |
LL |     let _ = unsafe { libc::strlen(cstr.as_ptr()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstr.to_bytes().len()`

error: using `libc::strlen` on a `CString` or `CStr` value
  --> $DIR/strlen_on_c_strings.rs:21:13
   |
LL |     let _ = unsafe { strlen(cstr.as_ptr()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstr.to_bytes().len()`

error: using `libc::strlen` on a `CString` or `CStr` value
  --> $DIR/strlen_on_c_strings.rs:24:22
   |
LL |     let _ = unsafe { strlen((*pcstr).as_ptr()) };
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*pcstr).to_bytes().len()`

error: using `libc::strlen` on a `CString` or `CStr` value
  --> $DIR/strlen_on_c_strings.rs:29:22
   |
LL |     let _ = unsafe { strlen(unsafe_identity(cstr).as_ptr()) };
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unsafe_identity(cstr).to_bytes().len()`

error: using `libc::strlen` on a `CString` or `CStr` value
  --> $DIR/strlen_on_c_strings.rs:30:13
   |
LL |     let _ = unsafe { strlen(unsafe { unsafe_identity(cstr) }.as_ptr()) };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unsafe { unsafe_identity(cstr) }.to_bytes().len()`

error: using `libc::strlen` on a `CString` or `CStr` value
  --> $DIR/strlen_on_c_strings.rs:33:22
   |
LL |     let _ = unsafe { strlen(f(cstr).as_ptr()) };
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `f(cstr).to_bytes().len()`

error: aborting due to 7 previous errors