1
0
Fork 0
forked from wry/wry

all: warn on unsafe-op-in-unsafe-fn

This commit is contained in:
Julian Orth 2024-10-20 18:39:11 +02:00
parent ce7488aa86
commit 73a6e0d5c2
25 changed files with 435 additions and 340 deletions

View file

@ -155,11 +155,13 @@ fn write_egl_procs<W: Write>(f: &mut W) -> anyhow::Result<()> {
writeln!(f, " if self.{}.is_null() {{", name)?;
writeln!(f, " panic!(\"Could not load `{}`\");", name)?;
writeln!(f, " }}")?;
writeln!(f, " unsafe {{")?;
writeln!(
f,
" ptr::read(&self.{} as *const *mut u8 as *const unsafe extern fn({}) -> {})({})",
" ptr::read(&self.{} as *const *mut u8 as *const unsafe extern fn({}) -> {})({})",
name, args_tys, ret, args_names
)?;
writeln!(f, " }}")?;
writeln!(f, " }}")?;
}
writeln!(f, "}}")?;