File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -418,13 +418,6 @@ fn get_args_and_types(f: &syn::ItemFn, config: &config::Config) ->
418
418
let arg_name;
419
419
if let syn:: Pat :: Ident ( ref pat_ident) = arg_captured. pat {
420
420
arg_name = pat_ident. ident . clone ( ) ;
421
- if let Some ( m) = pat_ident. mutability {
422
- if !config. ignore_args . contains ( & arg_name) {
423
- let diag = m. span . unstable ( )
424
- . error ( "`mut` arguments are not supported with lru_cache as this could lead to incorrect results being stored" ) ;
425
- return Err ( DiagnosticError :: new ( diag) ) ;
426
- }
427
- }
428
421
segments. push ( syn:: PathSegment { ident : pat_ident. ident . clone ( ) , arguments : syn:: PathArguments :: None } ) ;
429
422
} else {
430
423
let diag = arg_captured. span ( ) . unstable ( )
@@ -438,6 +431,11 @@ fn get_args_and_types(f: &syn::ItemFn, config: &config::Config) ->
438
431
439
432
// If the arg type is a reference, remove the reference because the arg will be cloned
440
433
if let syn:: Type :: Reference ( type_reference) = & arg_captured. ty {
434
+ if let Some ( m) = type_reference. mutability {
435
+ let diag = m. span . unstable ( )
436
+ . error ( "`mut` reference arguments are not supported as this could lead to incorrect results being stored" ) ;
437
+ return Err ( DiagnosticError :: new ( diag) ) ;
438
+ }
441
439
types. push ( type_reference. elem . as_ref ( ) . to_owned ( ) ) ; // as_ref -> to_owned unboxes the type
442
440
} else {
443
441
types. push ( arg_captured. ty . clone ( ) ) ;
You can’t perform that action at this time.
0 commit comments