Skip to content

fix unsound return lifetime on Weak*Mut::as_mut_slice()#539

Merged
folkertdev merged 1 commit into
trifectatechfoundation:mainfrom
Manishearth:unsound-return-lifetime
Jul 2, 2026
Merged

fix unsound return lifetime on Weak*Mut::as_mut_slice()#539
folkertdev merged 1 commit into
trifectatechfoundation:mainfrom
Manishearth:unsound-return-lifetime

Conversation

@Manishearth

Copy link
Copy Markdown
Contributor

This returns a mutable borrow while relinquishing mutable access to the source type. This is prone to lifetime extension bugs, but it's internal so it doesn't actually matter.

Worth fixing anyway.

(This issue was discovered by an audit performed using Gemini)

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
fuzz-compress ?
fuzz-decompress ?
test-aarch64-apple-darwin 90.00% <100.00%> (+<0.01%) ⬆️
test-aarch64-unknown-linux-gnu 85.42% <100.00%> (-0.01%) ⬇️
test-i686-unknown-linux-gnu 85.02% <100.00%> (-0.01%) ⬇️
test-x86_64-apple-darwin 88.28% <100.00%> (+<0.01%) ⬆️
test-x86_64-unknown-linux-gnu 90.81% <100.00%> (-1.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
zlib-rs/src/deflate/hash_calc.rs 100.00% <100.00%> (ø)
zlib-rs/src/weak_slice.rs 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@folkertdev

Copy link
Copy Markdown
Member

Nice, thanks!

@folkertdev
folkertdev merged commit 4a9d306 into trifectatechfoundation:main Jul 2, 2026
41 checks passed
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