Skip to content

Fix nonnull_unchecked_on_box_ptr lint - #243

Merged
jeromefroe merged 4 commits into
masterfrom
jerome/nonnull-unchecked-on-box-ptr
Aug 27, 2026
Merged

jeromefroe merged 4 commits into
masterfrom
jerome/nonnull-unchecked-on-box-ptr

Conversation

@jeromefroe

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is localized and resolves the lint without altering the cache’s core logic or invariants.

Pull request overview

This PR updates LruCache’s node allocation path to fix the Clippy nonnull_unchecked_on_box_ptr lint by removing an unsafe NonNull::new_unchecked(...) construction in favor of a safe NonNull creation approach.

Changes:

  • Replaces NonNull::new_unchecked(Box::into_raw(Box::new(...))) with a safe NonNull construction for newly allocated LruEntry nodes.
  • Removes the now-unneeded safety comment tied to the prior unsafe block.
File summaries
File Description
src/lib.rs Reworks node allocation to avoid NonNull::new_unchecked and satisfy the Clippy lint.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib.rs
jeromefroe and others added 2 commits August 27, 2026 16:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jeromefroe
jeromefroe merged commit f1c04a2 into master Aug 27, 2026
4 checks passed
@jeromefroe
jeromefroe deleted the jerome/nonnull-unchecked-on-box-ptr branch August 27, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants