rust-lang / rust-lang/rust-clippy

invalid_null_ptr_usage lacks explanation

Open
#8,652 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-documentation C-bug
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Summary
Why is this bad?
This causes undefined behavior.

I'm still left with no idea why. The entire point of using pointers instead of references is to be able to use things like null and not worry about lifetimes so why is there so much ceremony to express a null slice pointer?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the invalid_null_ptr_usage lint and its current explanation. Determine what rationale is missing about null slice pointers, references, lifetimes, and undefined behavior, then update the explanation so it directly addresses the reporter's question. Verify that the lint's documentation or explanation now makes the safety concern understandable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.