File tree 2 files changed +7
-4
lines changed
crates/ide-diagnostics/src
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ fn test() {
179
179
180
180
#[ test]
181
181
fn remove_unnecessary_else_for_return3 ( ) {
182
- check_diagnostics_with_needless_return_disabled (
182
+ check_diagnostics_with_disabled (
183
183
r#"
184
184
fn test(a: bool) -> i32 {
185
185
if a {
@@ -190,6 +190,7 @@ fn test(a: bool) -> i32 {
190
190
}
191
191
}
192
192
"# ,
193
+ & [ "needless_return" , "E0425" ] ,
193
194
) ;
194
195
check_fix (
195
196
r#"
@@ -473,7 +474,7 @@ fn test() {
473
474
474
475
#[ test]
475
476
fn no_diagnostic_if_not_expr_stmt ( ) {
476
- check_diagnostics_with_needless_return_disabled (
477
+ check_diagnostics_with_disabled (
477
478
r#"
478
479
fn test1() {
479
480
let _x = if a {
@@ -495,13 +496,15 @@ fn test2() {
495
496
};
496
497
}
497
498
"# ,
499
+ & [ "needless_return" , "E0425" ] ,
498
500
) ;
499
- check_diagnostics (
501
+ check_diagnostics_with_disabled (
500
502
r#"
501
503
fn test3() -> u8 {
502
504
foo(if a { return 1 } else { 0 })
503
505
}
504
506
"# ,
507
+ & [ "E0425" ] ,
505
508
) ;
506
509
}
507
510
}
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ pub(crate) fn check_diagnostics(ra_fixture: &str) {
200
200
#[ track_caller]
201
201
pub ( crate ) fn check_diagnostics_with_disabled ( ra_fixture : & str , disabled : & [ & str ] ) {
202
202
let mut config = DiagnosticsConfig :: test_sample ( ) ;
203
- config. disabled . extend ( disabled. into_iter ( ) . map ( |& s| s. to_owned ( ) ) ) ;
203
+ config. disabled . extend ( disabled. iter ( ) . map ( |& s| s. to_owned ( ) ) ) ;
204
204
check_diagnostics_with_config ( config, ra_fixture)
205
205
}
206
206
You can’t perform that action at this time.
0 commit comments