about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorLzu Tao <taolzu@gmail.com>2024-07-11 05:10:20 +0000
committerLzu Tao <taolzu@gmail.com>2024-07-11 22:50:23 +0000
commita776e5f922d3b39d74d4b4d3acb752ce3585a2fb (patch)
treef3d21f02e9e2d72507a42bbbcc2d2b5e546b75f5 /compiler
parent872d7b82e181235bdf8842847c76592f70419b09 (diff)
downloadrust-a776e5f922d3b39d74d4b4d3acb752ce3585a2fb.tar.gz
rust-a776e5f922d3b39d74d4b4d3acb752ce3585a2fb.zip
Add doc for deconstruct_option_or_result
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
index 50c4e9d5d60..0817ad3aed2 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<T>`, returns `T, T, None`.
+    /// If `ty` is `Result<T, E>`, returns `T, T, Some(E, E)`.
+    /// Otherwise, returns `None`.
     fn deconstruct_option_or_result(
         &self,
         found_ty: Ty<'tcx>,