aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ide_assists/src/handlers/fill_match_arms.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/crates/ide_assists/src/handlers/fill_match_arms.rs b/crates/ide_assists/src/handlers/fill_match_arms.rs
index e4794f17c..6408d7f0b 100644
--- a/crates/ide_assists/src/handlers/fill_match_arms.rs
+++ b/crates/ide_assists/src/handlers/fill_match_arms.rs
@@ -504,6 +504,40 @@ fn main() {
504 ); 504 );
505 } 505 }
506 506
507 // Fixme: This fails with extra useless match arms added.
508 // To fix, it needs full fledged match exhaustiveness checking from
509 // hir_ty::diagnostics::match_check
510 // see https://github.com/rust-analyzer/rust-analyzer/issues/8493
511 #[ignore]
512 #[test]
513 fn fill_match_arms_tuple_of_enum_partial_with_wildcards() {
514 let ra_fixture = r#"
515fn main() {
516 let a = Some(1);
517 let b = Some(());
518 match (a$0, b) {
519 (Some(_), _) => {}
520 (None, Some(_)) => {}
521 }
522}
523"#;
524 check_assist(
525 fill_match_arms,
526 &format!("//- /main.rs crate:main deps:core{}{}", ra_fixture, FamousDefs::FIXTURE),
527 r#"
528fn main() {
529 let a = Some(1);
530 let b = Some(());
531 match (a, b) {
532 (Some(_), _) => {}
533 (None, Some(_)) => {}
534 $0(None, None) => {}
535 }
536}
537"#,
538 );
539 }
540
507 #[test] 541 #[test]
508 fn fill_match_arms_tuple_of_enum_not_applicable() { 542 fn fill_match_arms_tuple_of_enum_not_applicable() {
509 check_assist_not_applicable( 543 check_assist_not_applicable(