Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fc96678

Browse filesBrowse files
committed
proc_macro: Apply unsafe_op_in_unsafe_fn
1 parent c5dae23 commit fc96678
Copy full SHA for fc96678

File tree

Expand file treeCollapse file tree

2 files changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-1
lines changed

‎library/proc_macro/src/bridge/closure.rs

Copy file name to clipboardExpand all lines: library/proc_macro/src/bridge/closure.rs
+1-1Lines changed: 1 addition & 1 deletion
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

Copy file name to clipboardExpand all lines: library/proc_macro/src/lib.rs
+1Lines changed: 1 addition & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.