A-lintL-correctnessT-middlegood first issue
倉庫指標
- Star
- (10,406 star)
- PR 合併指標
- (平均合併 19天 22小時) (30 天內合併 113 個 PR)
描述
Hello.
It would be nice to have a warning when using str::as_ptr() in a ffi call instead of using CStr.
For instance, in the following code:
unsafe { printf("Hello".as_ptr() as *const _) };
should give a warning and propose something like:
let cstring = CString::new("Hello".as_bytes()).unwrap();
unsafe { printf(cstring.as_ptr()) };
Thanks to add this lint.