Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a776e5f

Browse files
committedJul 11, 2024
Add doc for deconstruct_option_or_result
1 parent 872d7b8 commit a776e5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+3
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
521521
false
522522
}
523523

524+
/// If `ty` is `Option<T>`, returns `T, T, None`.
525+
/// If `ty` is `Result<T, E>`, returns `T, T, Some(E, E)`.
526+
/// Otherwise, returns `None`.
524527
fn deconstruct_option_or_result(
525528
&self,
526529
found_ty: Ty<'tcx>,

0 commit comments

Comments
 (0)
Failed to load comments.