Closed
Description
Quoting the docs of the lint:
What it does: This lint checks for getting the inner pointer of a temporary CString.
Why is this bad? The inner pointer of a CString is only valid as long as the CString is alive.
@akademik someone found in a recent discussion that there are hundreds of .unwrap().as_ptr()
calls to be found on github (not all of them UB, but many).
I believe this amount of accidental UB is reason enough to add a "new" lint to rustc that prevents misusing this specific easy-to-misuse method.
Metadata
Metadata
Assignees
Labels
No labels