Skip to content

Use NonNull in Allocator#638

Open
stepancheg wants to merge 1 commit intocapnproto:masterfrom
stepancheg:non-null
Open

Use NonNull in Allocator#638
stepancheg wants to merge 1 commit intocapnproto:masterfrom
stepancheg:non-null

Conversation

@stepancheg
Copy link
Copy Markdown
Contributor

@stepancheg stepancheg commented Mar 29, 2026

This matches API of std allocator https://doc.rust-lang.org/std/alloc/trait.Allocator.html

But more broadly speaking, in capnp-rust codebase, some pointers are used with zero is information, and in other places pointer being zero is not valid. might be better to convert all the pointers to NonNull, and use Option where null value is expected.

All pointers start with allocator, so this PR.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 29, 2026

Codecov Report

❌ Patch coverage is 82.92683% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.00%. Comparing base (ab342b3) to head (d9229c0).
⚠️ Report is 280 commits behind head on master.

Files with missing lines Patch % Lines
capnp/src/message.rs 80.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #638      +/-   ##
==========================================
- Coverage   51.64%   51.00%   -0.65%     
==========================================
  Files          69       71       +2     
  Lines       33735    32515    -1220     
==========================================
- Hits        17422    16583     -839     
+ Misses      16313    15932     -381     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dwrensha dwrensha added the breaking change requires version bump label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change requires version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants