2021-07-15 03:44:10 -05:00
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/strlen_on_c_strings.rs:13:13
|
2021-07-15 03:44:10 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
LL | let _ = unsafe { libc::strlen(cstring.as_ptr()) };
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstring.as_bytes().len()`
|
2021-07-15 03:44:10 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::strlen-on-c-strings` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::strlen_on_c_strings)]`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/strlen_on_c_strings.rs:17:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { libc::strlen(cstr.as_ptr()) };
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstr.to_bytes().len()`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/strlen_on_c_strings.rs:19:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = unsafe { strlen(cstr.as_ptr()) };
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cstr.to_bytes().len()`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/strlen_on_c_strings.rs:22:22
|
2021-07-15 03:44:10 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
LL | let _ = unsafe { strlen((*pcstr).as_ptr()) };
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*pcstr).to_bytes().len()`
|
2021-07-15 03:44:10 -05:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/strlen_on_c_strings.rs:27:22
|
2021-07-15 03:44:10 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
LL | let _ = unsafe { strlen(unsafe_identity(cstr).as_ptr()) };
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unsafe_identity(cstr).to_bytes().len()`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/strlen_on_c_strings.rs:28:13
|
2021-07-15 03:44:10 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
LL | let _ = unsafe { strlen(unsafe { unsafe_identity(cstr) }.as_ptr()) };
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unsafe { unsafe_identity(cstr) }.to_bytes().len()`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: using `libc::strlen` on a `CString` or `CStr` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/strlen_on_c_strings.rs:31:22
|
2021-07-15 03:44:10 -05:00
|
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
LL | let _ = unsafe { strlen(f(cstr).as_ptr()) };
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `f(cstr).to_bytes().len()`
|
2021-07-15 03:44:10 -05:00
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
error: aborting due to 7 previous errors
|
2021-07-15 03:44:10 -05:00
|
|
|
|