diff --git a/reporting/src/error/mono.rs b/reporting/src/error/mono.rs index d3630f5571..215bc3eeaf 100644 --- a/reporting/src/error/mono.rs +++ b/reporting/src/error/mono.rs @@ -167,7 +167,8 @@ fn pattern_to_doc_help<'b>( TagName::Global("#Guard".into()) ); debug_assert!(args.len() == 2); - pattern_to_doc_help(alloc, args[1].clone(), in_type_param) + let tag = pattern_to_doc_help(alloc, args[1].clone(), in_type_param); + tag.append(" (note the lack of a guard)") } RenderAs::Record(field_names) => { let mut arg_docs = Vec::with_capacity(args.len()); diff --git a/reporting/tests/test_reporting.rs b/reporting/tests/test_reporting.rs index 94abdc31d2..df31c1fafd 100644 --- a/reporting/tests/test_reporting.rs +++ b/reporting/tests/test_reporting.rs @@ -8486,6 +8486,8 @@ I need all branches in an `if` to have the same type! ), ) } + + #[test] fn non_exhaustive_with_guard() { report_problem_as( indoc!( @@ -8506,7 +8508,7 @@ I need all branches in an `if` to have the same type! Other possibilities include: - A + A (note the lack of a guard) I would have to crash if I saw one of those! Add branches for them! "#