Skip to content

Commit fc96678

Browse files
committed
proc_macro: Apply unsafe_op_in_unsafe_fn
1 parent c5dae23 commit fc96678

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

library/proc_macro/src/bridge/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct Env;
1919
impl<'a, A, R, F: FnMut(A) -> R> From<&'a mut F> for Closure<'a, A, R> {
2020
fn from(f: &'a mut F) -> Self {
2121
unsafe extern "C" fn call<A, R, F: FnMut(A) -> R>(env: *mut Env, arg: A) -> R {
22-
(*(env as *mut _ as *mut F))(arg)
22+
unsafe { (*(env as *mut _ as *mut F))(arg) }
2323
}
2424
Closure { call: call::<A, R, F>, env: f as *mut _ as *mut Env, _marker: PhantomData }
2525
}

library/proc_macro/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#![deny(ffi_unwind_calls)]
3434
#![warn(rustdoc::unescaped_backticks)]
3535
#![warn(unreachable_pub)]
36+
#![deny(unsafe_op_in_unsafe_fn)]
3637

3738
#[unstable(feature = "proc_macro_internals", issue = "27812")]
3839
#[doc(hidden)]

0 commit comments

Comments
 (0)