Skip to content

Commit 97a42b8

Browse files
committed
op2 -> raw_fn
1 parent f637e50 commit 97a42b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ops/op2/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ fn generate_op2(
102102
op_fn.sig.generics.params.clear();
103103
op_fn.sig.ident = call.clone();
104104

105+
// create raw version
106+
let mut raw_fn = func.clone();
107+
let raw_ident = format_ident!("{}__raw_fn", &func.sig.ident);
108+
raw_fn.sig.ident = raw_ident.clone();
109+
raw_fn.attrs.retain(|attr| !is_attribute_special(attr));
110+
for arg in raw_fn.sig.inputs.iter_mut() {
111+
match arg {
112+
FnArg::Receiver(slf) => slf.attrs.clear(),
113+
FnArg::Typed(ty) => ty.attrs.clear(),
114+
}
115+
}
116+
105117
// Clear inert attributes
106118
// TODO(mmastrac): This should limit itself to clearing ours only
107119
for arg in op_fn.sig.inputs.iter_mut() {
@@ -320,6 +332,9 @@ fn generate_op2(
320332

321333
<#name <#(#generic),*> as ::deno_core::_ops::Op>::DECL
322334
}
335+
336+
#[allow(unused, non_snake_case)]
337+
#raw_fn
323338
})
324339
}
325340

0 commit comments

Comments
 (0)