@@ -97,13 +97,9 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &RemoveUnnecessaryElse) -> Option<Vec<
9797mod tests {
9898 use crate :: tests:: { check_diagnostics, check_diagnostics_with_disabled, check_fix} ;
9999
100- fn check_diagnostics_with_needless_return_disabled ( ra_fixture : & str ) {
101- check_diagnostics_with_disabled ( ra_fixture, std:: iter:: once ( "needless_return" . to_owned ( ) ) ) ;
102- }
103-
104100 #[ test]
105101 fn remove_unnecessary_else_for_return ( ) {
106- check_diagnostics_with_needless_return_disabled (
102+ check_diagnostics_with_disabled (
107103 r#"
108104fn test() {
109105 if foo {
@@ -114,6 +110,7 @@ fn test() {
114110 }
115111}
116112"# ,
113+ & [ "needless_return" ] ,
117114 ) ;
118115 check_fix (
119116 r#"
@@ -138,7 +135,7 @@ fn test() {
138135
139136 #[ test]
140137 fn remove_unnecessary_else_for_return2 ( ) {
141- check_diagnostics_with_needless_return_disabled (
138+ check_diagnostics_with_disabled (
142139 r#"
143140fn test() {
144141 if foo {
@@ -151,6 +148,7 @@ fn test() {
151148 }
152149}
153150"# ,
151+ & [ "needless_return" ] ,
154152 ) ;
155153 check_fix (
156154 r#"
@@ -216,7 +214,7 @@ fn test(a: bool) -> i32 {
216214
217215 #[ test]
218216 fn remove_unnecessary_else_for_return_in_child_if_expr ( ) {
219- check_diagnostics_with_needless_return_disabled (
217+ check_diagnostics_with_disabled (
220218 r#"
221219fn test() {
222220 if foo {
@@ -229,6 +227,7 @@ fn test() {
229227 }
230228}
231229"# ,
230+ & [ "needless_return" ] ,
232231 ) ;
233232 check_fix (
234233 r#"
@@ -453,7 +452,7 @@ fn test() {
453452
454453 #[ test]
455454 fn no_diagnostic_if_no_divergence_in_else_branch ( ) {
456- check_diagnostics_with_needless_return_disabled (
455+ check_diagnostics_with_disabled (
457456 r#"
458457fn test() {
459458 if foo {
@@ -463,6 +462,7 @@ fn test() {
463462 }
464463}
465464"# ,
465+ & [ "needless_return" ] ,
466466 ) ;
467467 }
468468
0 commit comments