chore(safety): two .133 gate findings — cfg the abi lock helper, re-anchor a layer proof
ci / bun-nix (pull_request) Successful in 40s
ci / web (pull_request) Successful in 1m24s
ci / docs-site (pull_request) Successful in 1m30s
android / android (pull_request) Canceled after 1m45s
apple / swift (pull_request) Canceled after 1m41s
apple / screenshots (pull_request) Canceled after 0s
ci / rust (pull_request) Canceled after 1m43s
ci / rust-arm64 (pull_request) Canceled after 1m43s
nix / flake (pull_request) Canceled after 1m29s
windows-drivers / probe-and-proto (pull_request) Canceled after 0s
windows-drivers / driver-build (pull_request) Canceled after 1m25s
windows / build (aarch64-pc-windows-msvc) (pull_request) Canceled after 0s
windows / build (x86_64-pc-windows-msvc) (pull_request) Canceled after 0s

The tray leg builds punktfunk-core with default-features off, where
lock_recover's only callers (the quic-gated punktfunk_connection_* entry
points) do not exist — dead code under -D warnings. The helper takes the
same feature gate.

In pf-vkhdr-layer, rustfmt had reflowed destroy_surface's lookup into a
multiline closure, leaving the SAFETY comment outside the closure that
contains its unsafe block — the box's clippy rightly stopped accepting the
adjacency. The comment moves inside, directly above the block.
This commit is contained in:
2026-08-11 23:51:01 +02:00
parent abec2a1457
commit d67ab9ede4
2 changed files with 7 additions and 7 deletions
+3
View File
@@ -59,6 +59,9 @@ use std::ptr;
/// for. The slots behind these mutexes are plain last-value caches (frame/audio/cursor/clip), so
/// whatever a poisoned writer left behind is still structurally valid data to overwrite or hand
/// out; recovering the guard is strictly better than aborting the embedding application.
/// (`quic`-gated with its only callers, the `punktfunk_connection_*` entry points — a
/// `default-features = false` consumer like the tray would otherwise see dead code.)
#[cfg(feature = "quic")]
fn lock_recover<T>(m: &std::sync::Mutex<T>) -> std::sync::MutexGuard<'_, T> {
m.lock().unwrap_or_else(std::sync::PoisonError::into_inner)
}
+4 -7
View File
@@ -904,15 +904,12 @@ unsafe extern "system" fn destroy_surface(
if let Ok(mut m) = surface_hwnds().lock() {
m.remove(&surface.as_raw());
}
let down = instances()
.lock()
.ok()
let down = instances().lock().ok().and_then(|g| {
// SAFETY: vkDestroySurfaceKHR requires `inst` to be a live instance handle — a
// dispatchable object whose first word is the dispatch key.
.and_then(|g| {
g.get(&unsafe { key(inst.as_raw()) })
.and_then(|d| d.destroy_surface)
});
g.get(&unsafe { key(inst.as_raw()) })
.and_then(|d| d.destroy_surface)
});
if let Some(f) = down {
// SAFETY: `f` is the down-chain vkDestroySurfaceKHR resolved for this instance at
// create time; forwarding the caller's own arguments unchanged.