From a40ade5f30f08dfc053472239b1924262d4702ae Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Thu, 11 Jul 2024 05:10:20 +0000 Subject: [PATCH] Add doc for deconstruct_option_or_result --- compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs index 50c4e9d5d6076..0817ad3aed2c2 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs @@ -521,6 +521,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { false } + /// If `ty` is `Option`, returns `T, T, None`. + /// If `ty` is `Result`, returns `T, T, Some(E, E)`. + /// Otherwise, returns `None`. fn deconstruct_option_or_result( &self, found_ty: Ty<'tcx>,