@@ -95,7 +95,7 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &RemoveUnnecessaryElse) -> Option<Vec<
9595
9696#[ cfg( test) ]
9797mod tests {
98- use crate :: tests:: { check_diagnostics , check_diagnostics_with_disabled, check_fix} ;
98+ use crate :: tests:: { check_diagnostics_with_disabled, check_fix} ;
9999
100100 #[ test]
101101 fn remove_unnecessary_else_for_return ( ) {
@@ -110,7 +110,7 @@ fn test() {
110110 }
111111}
112112"# ,
113- & [ "needless_return" ] ,
113+ & [ "needless_return" , "E0425" ] ,
114114 ) ;
115115 check_fix (
116116 r#"
@@ -148,7 +148,7 @@ fn test() {
148148 }
149149}
150150"# ,
151- & [ "needless_return" ] ,
151+ & [ "needless_return" , "E0425" ] ,
152152 ) ;
153153 check_fix (
154154 r#"
@@ -227,7 +227,7 @@ fn test() {
227227 }
228228}
229229"# ,
230- & [ "needless_return" ] ,
230+ & [ "needless_return" , "E0425" ] ,
231231 ) ;
232232 check_fix (
233233 r#"
@@ -293,7 +293,7 @@ fn test() {
293293
294294 #[ test]
295295 fn remove_unnecessary_else_for_break ( ) {
296- check_diagnostics (
296+ check_diagnostics_with_disabled (
297297 r#"
298298fn test() {
299299 loop {
@@ -306,6 +306,7 @@ fn test() {
306306 }
307307}
308308"# ,
309+ & [ "E0425" ] ,
309310 ) ;
310311 check_fix (
311312 r#"
@@ -334,7 +335,7 @@ fn test() {
334335
335336 #[ test]
336337 fn remove_unnecessary_else_for_continue ( ) {
337- check_diagnostics (
338+ check_diagnostics_with_disabled (
338339 r#"
339340fn test() {
340341 loop {
@@ -347,6 +348,7 @@ fn test() {
347348 }
348349}
349350"# ,
351+ & [ "E0425" ] ,
350352 ) ;
351353 check_fix (
352354 r#"
@@ -375,7 +377,7 @@ fn test() {
375377
376378 #[ test]
377379 fn remove_unnecessary_else_for_never ( ) {
378- check_diagnostics (
380+ check_diagnostics_with_disabled (
379381 r#"
380382fn test() {
381383 if foo {
@@ -390,6 +392,7 @@ fn never() -> ! {
390392 loop {}
391393}
392394"# ,
395+ & [ "E0425" ] ,
393396 ) ;
394397 check_fix (
395398 r#"
@@ -422,7 +425,7 @@ fn never() -> ! {
422425
423426 #[ test]
424427 fn no_diagnostic_if_no_else_branch ( ) {
425- check_diagnostics (
428+ check_diagnostics_with_disabled (
426429 r#"
427430fn test() {
428431 if foo {
@@ -432,12 +435,13 @@ fn test() {
432435 do_something_else();
433436}
434437"# ,
438+ & [ "E0425" ] ,
435439 ) ;
436440 }
437441
438442 #[ test]
439443 fn no_diagnostic_if_no_divergence ( ) {
440- check_diagnostics (
444+ check_diagnostics_with_disabled (
441445 r#"
442446fn test() {
443447 if foo {
@@ -447,6 +451,7 @@ fn test() {
447451 }
448452}
449453"# ,
454+ & [ "E0425" ] ,
450455 ) ;
451456 }
452457
@@ -462,7 +467,7 @@ fn test() {
462467 }
463468}
464469"# ,
465- & [ "needless_return" ] ,
470+ & [ "needless_return" , "E0425" ] ,
466471 ) ;
467472 }
468473
0 commit comments