diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/zst_offset.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/zst_offset.txt b/src/tools/clippy/src/docs/zst_offset.txt new file mode 100644 index 000000000..5810455ee --- /dev/null +++ b/src/tools/clippy/src/docs/zst_offset.txt @@ -0,0 +1,11 @@ +### What it does +Checks for `offset(_)`, `wrapping_`{`add`, `sub`}, etc. on raw pointers to +zero-sized types + +### Why is this bad? +This is a no-op, and likely unintended + +### Example +``` +unsafe { (&() as *const ()).offset(1) }; +```
\ No newline at end of file |