diff options
| author | Lzu Tao <taolzu@gmail.com> | 2024-07-11 05:10:20 +0000 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2024-07-11 22:50:23 +0000 |
| commit | a776e5f922d3b39d74d4b4d3acb752ce3585a2fb (patch) | |
| tree | f3d21f02e9e2d72507a42bbbcc2d2b5e546b75f5 /compiler | |
| parent | 872d7b82e181235bdf8842847c76592f70419b09 (diff) | |
| download | rust-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.rs | 3 |
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>, |
