2021-07-15 08:44:10 +00:00
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2021-11-24 21:06:13 +00:00
|
|
|
--> $DIR/strlen_on_c_strings.rs:15:13
|
2021-07-15 08:44:10 +00:00
|
|
|
|
|
2021-11-24 21:06:13 +00:00
|
|
|
LL | let _ = unsafe { libc::strlen(cstring.as_ptr()) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstring.as_bytes().len()`
|
2021-07-15 08:44:10 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::strlen-on-c-strings` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2021-11-24 21:06:13 +00:00
|
|
|
--> $DIR/strlen_on_c_strings.rs:19:13
|
2021-07-15 08:44:10 +00:00
|
|
|
|
|
2021-11-24 21:06:13 +00:00
|
|
|
LL | let _ = unsafe { libc::strlen(cstr.as_ptr()) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstr.to_bytes().len()`
|
2021-11-20 01:51:20 +00:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2021-11-24 21:06:13 +00:00
|
|
|
--> $DIR/strlen_on_c_strings.rs:21:13
|
2021-07-15 08:44:10 +00:00
|
|
|
|
|
2021-11-24 21:06:13 +00:00
|
|
|
LL | let _ = unsafe { strlen(cstr.as_ptr()) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `cstr.to_bytes().len()`
|
2021-11-20 01:51:20 +00:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2021-11-24 21:06:13 +00:00
|
|
|
--> $DIR/strlen_on_c_strings.rs:24:22
|
2021-07-15 08:44:10 +00:00
|
|
|
|
|
2021-11-24 21:06:13 +00:00
|
|
|
LL | let _ = unsafe { strlen((*pcstr).as_ptr()) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `(*pcstr).to_bytes().len()`
|
2021-07-15 08:44:10 +00:00
|
|
|
|
2021-11-20 01:02:49 +00:00
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2021-11-24 21:06:13 +00:00
|
|
|
--> $DIR/strlen_on_c_strings.rs:29:22
|
2021-11-20 01:02:49 +00:00
|
|
|
|
|
2021-11-24 21:06:13 +00:00
|
|
|
LL | let _ = unsafe { strlen(unsafe_identity(cstr).as_ptr()) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unsafe_identity(cstr).to_bytes().len()`
|
2021-11-20 01:51:20 +00:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2021-11-24 21:06:13 +00:00
|
|
|
--> $DIR/strlen_on_c_strings.rs:30:13
|
2021-11-20 01:02:49 +00:00
|
|
|
|
|
2021-11-24 21:06:13 +00:00
|
|
|
LL | let _ = unsafe { strlen(unsafe { unsafe_identity(cstr) }.as_ptr()) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unsafe { unsafe_identity(cstr) }.to_bytes().len()`
|
2021-11-20 01:51:20 +00:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2021-11-24 21:06:13 +00:00
|
|
|
--> $DIR/strlen_on_c_strings.rs:33:22
|
2021-11-20 01:02:49 +00:00
|
|
|
|
|
2021-11-24 21:06:13 +00:00
|
|
|
LL | let _ = unsafe { strlen(f(cstr).as_ptr()) };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `f(cstr).to_bytes().len()`
|
2021-11-20 01:02:49 +00:00
|
|
|
|
2021-11-20 01:51:20 +00:00
|
|
|
error: aborting due to 7 previous errors
|
2021-07-15 08:44:10 +00:00
|
|
|
|