Rollup merge of #137712 - meithecatte:extract-binding-mode, r=oli-obk

Clean up TypeckResults::extract_binding_mode

- Remove the `Option` from the result type, as `None` is never returned.
- Document the difference from the `BindingMode` in `PatKind::Binding`.
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2025-02-28 21:42:00 +08:00 committed by GitHub
commit 222aaba5a1

View file

@ -1094,7 +1094,6 @@ pub fn capture_local_usage(cx: &LateContext<'_>, e: &Expr<'_>) -> CaptureKind {
pat.each_binding_or_first(&mut |_, id, span, _| match cx
.typeck_results()
.extract_binding_mode(cx.sess(), id, span)
.unwrap()
.0
{
ByRef::No if !is_copy(cx, cx.typeck_results().node_type(id)) => {