15 lines
No EOL
435 B
Text
15 lines
No EOL
435 B
Text
### What it does
|
|
Checks for transmute calls which would receive a null pointer.
|
|
|
|
### Why is this bad?
|
|
Transmuting a null pointer is undefined behavior.
|
|
|
|
### Known problems
|
|
Not all cases can be detected at the moment of this writing.
|
|
For example, variables which hold a null pointer and are then fed to a `transmute`
|
|
call, aren't detectable yet.
|
|
|
|
### Example
|
|
```
|
|
let null_ref: &u64 = unsafe { std::mem::transmute(0 as *const u64) };
|
|
``` |