File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,17 @@ impl FunctionData {
58
58
}
59
59
if flags. bits & FnFlags :: HAS_SELF_PARAM != 0 {
60
60
// If there's a self param in the syntax, but it is cfg'd out, remove the flag.
61
- cov_mark:: hit!( cfgd_out_self_param) ;
62
- let param =
63
- func. params . clone ( ) . next ( ) . expect ( "fn HAS_SELF_PARAM but no parameters allocated" ) ;
64
- if !item_tree. attrs ( db, krate, param. into ( ) ) . is_cfg_enabled ( cfg_options) {
61
+ let is_cfgd_out = match func. params . clone ( ) . next ( ) {
62
+ Some ( param) => {
63
+ !item_tree. attrs ( db, krate, param. into ( ) ) . is_cfg_enabled ( cfg_options)
64
+ }
65
+ None => {
66
+ stdx:: never!( "fn HAS_SELF_PARAM but no parameters allocated" ) ;
67
+ true
68
+ }
69
+ } ;
70
+ if is_cfgd_out {
71
+ cov_mark:: hit!( cfgd_out_self_param) ;
65
72
flags. bits &= !FnFlags :: HAS_SELF_PARAM ;
66
73
}
67
74
}
You can’t perform that action at this time.
0 commit comments