summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_hir_typeck/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_typeck/src/errors.rs')
-rw-r--r--compiler/rustc_hir_typeck/src/errors.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/compiler/rustc_hir_typeck/src/errors.rs b/compiler/rustc_hir_typeck/src/errors.rs
index 05906a4b9..054d23c71 100644
--- a/compiler/rustc_hir_typeck/src/errors.rs
+++ b/compiler/rustc_hir_typeck/src/errors.rs
@@ -252,6 +252,46 @@ impl HelpUseLatestEdition {
}
}
+#[derive(Subdiagnostic)]
+pub enum OptionResultRefMismatch {
+ #[suggestion(
+ hir_typeck_option_result_copied,
+ code = ".copied()",
+ style = "verbose",
+ applicability = "machine-applicable"
+ )]
+ Copied {
+ #[primary_span]
+ span: Span,
+ def_path: String,
+ },
+ #[suggestion(
+ hir_typeck_option_result_cloned,
+ code = ".cloned()",
+ style = "verbose",
+ applicability = "machine-applicable"
+ )]
+ Cloned {
+ #[primary_span]
+ span: Span,
+ def_path: String,
+ },
+ // FIXME: #114050
+ // #[suggestion(
+ // hir_typeck_option_result_asref,
+ // code = ".as_ref()",
+ // style = "verbose",
+ // applicability = "machine-applicable"
+ // )]
+ // AsRef {
+ // #[primary_span]
+ // span: Span,
+ // def_path: String,
+ // expected_ty: Ty<'tcx>,
+ // expr_ty: Ty<'tcx>,
+ // },
+}
+
#[derive(Diagnostic)]
#[diag(hir_typeck_const_select_must_be_const)]
#[help]