You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
c_import static inline: a field of a by-value struct parameter passed to a raw call emits a redundant nested unsafe prefix (warning on every such header) #1433
warning: redundant unsafe prefix inside unsafe context
--> <c_import …>:44:27
44 | unsafe { with_free((((unsafe *(&raw const __param_c as *const Counter)).n as *mut c_void) as *mut u8)) }
What happens
The translation of a static inline body that reads a field of a by-value struct parameter, when that field is passed to a raw call, emits an inner unsafe * prefix inside the unsafe { } that wraps the call.
Expected
The generated body is warning-free, like the migrator's output since the redundant-unsafe fix: the prefix is emitted only outside an unsafe context.
Every c_import test fixture that frees through a by-value struct parameter prints this warning. The stage 5 debug-alloc fixtures on #1426 hit it.
Activity
ehartford commentedon Sep 26, 2026
Duplicate of #1704 (the redundant unsafe prefix in translated code); fixed in #1707.