File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments