diff options
Diffstat (limited to 'src/docs/invalid_null_ptr_usage.txt')
| -rw-r--r-- | src/docs/invalid_null_ptr_usage.txt | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/docs/invalid_null_ptr_usage.txt b/src/docs/invalid_null_ptr_usage.txt deleted file mode 100644 index 6fb3fa3f83d..00000000000 --- a/src/docs/invalid_null_ptr_usage.txt +++ /dev/null @@ -1,16 +0,0 @@ -### What it does -This lint checks for invalid usages of `ptr::null`. - -### Why is this bad? -This causes undefined behavior. - -### Example -``` -// Undefined behavior -unsafe { std::slice::from_raw_parts(ptr::null(), 0); } -``` - -Use instead: -``` -unsafe { std::slice::from_raw_parts(NonNull::dangling().as_ptr(), 0); } -``` \ No newline at end of file |
