Skip to content

Commit 49bbb61

Browse files
unsafe_method/unsafe_fn - before partially reverting to tuple_tree
1 parent c3387c0 commit 49bbb61

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,12 @@ macro_rules! unsafe_fn {
101101
// an array/slice and then it's indexed with array access suffix [usize_idx].
102102
(
103103
if false {
104+
#[deny(unused_unsafe)]
104105
let _ = $fn;
105-
$( let _ = $arg; )*
106+
$(
107+
#[deny(unused_unsafe)]
108+
let _ = $arg;
109+
)*
106110
unreachable!()
107111
} else {
108112
#[allow(unsafe_code)]
@@ -211,6 +215,7 @@ macro_rules! unsafe_method_internal {
211215
// **static** variable.
212216
let rref = {
213217
#[rustfmt::skip]
218+
#[deny(unused_unsafe)]
214219
// @TODO simplify once https://github.com/rust-lang/rust/issues/15701
215220
// (attributes on expressions)
216221
#[deny(unsafe_code)]
@@ -240,7 +245,10 @@ macro_rules! unsafe_method_internal {
240245
// 2. #[deny(unused_unsafe)]
241246
let _ = unsafe { owned_receiver. $fn( $( $arg ),* ) };
242247
} else {
243-
$( let _ = $arg; )*
248+
$(
249+
#[deny(unused_unsafe)]
250+
let _ = $arg;
251+
)*
244252
}
245253
unreachable!()
246254
} else {

0 commit comments

Comments
 (0)