We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac4fadc commit a09abbbCopy full SHA for a09abbb
1 file changed
crates/block2/src/block.rs
@@ -96,9 +96,11 @@ impl<F: ?Sized> Block<F> {
96
unsafe { RcBlock::copy(ptr) }.unwrap_or_else(|| block_copy_fail())
97
}
98
99
+ #[inline]
100
pub(crate) fn invoke_ptr(&self) -> unsafe extern "C-unwind" fn() {
- // TODO: Is `invoke` actually ever null?
101
- self.header().invoke.unwrap_or_else(|| unreachable!())
+ // SAFETY: `invoke` is never NULL - Clang also assumes this in its
102
+ // codegen, and will null ptr deref if it is.
103
+ unsafe { self.header().invoke.unwrap_unchecked() }
104
105
106
0 commit comments