]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_analysis/src/errors.rs
Rollup merge of #103221 - TaKO8Ki:fix-103202, r=oli-obk
[rust.git] / compiler / rustc_hir_analysis / src / errors.rs
index d891171b82468f05f5b19cdb9c05ebd1e9728bd6..41f73323d9a9aee6f22f8a073659a61d286d2a6a 100644 (file)
@@ -346,3 +346,29 @@ pub struct ExpectedUsedSymbol {
     #[primary_span]
     pub span: Span,
 }
+
+#[derive(Diagnostic)]
+#[diag(hir_analysis::missing_parentheses_in_range, code = "E0689")]
+pub struct MissingParentheseInRange {
+    #[primary_span]
+    #[label(hir_analysis::missing_parentheses_in_range)]
+    pub span: Span,
+    pub ty_str: String,
+    pub method_name: String,
+
+    #[subdiagnostic]
+    pub add_missing_parentheses: Option<AddMissingParenthesesInRange>,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion_verbose(
+    hir_analysis::add_missing_parentheses_in_range,
+    applicability = "maybe-incorrect"
+)]
+pub struct AddMissingParenthesesInRange {
+    pub func_name: String,
+    #[suggestion_part(code = "(")]
+    pub left: Span,
+    #[suggestion_part(code = ")")]
+    pub right: Span,
+}