about summary refs log tree commit diff
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-05-27 01:29:18 +0800
committerGitHub <noreply@github.com>2025-05-27 01:29:18 +0800
commitce0adf08c9c08a770fa65c98cdb59335d4acee3d (patch)
tree5ce144fdcf66053117b681ff8903b61c5e1a5543
parent09c50a4b6f8772df3b0528a9830060c5ad2f3904 (diff)
parent6059d59548f94a43b346b0b95c7a74e2dd9b1aa0 (diff)
downloadrust-ce0adf08c9c08a770fa65c98cdb59335d4acee3d.tar.gz
rust-ce0adf08c9c08a770fa65c98cdb59335d4acee3d.zip
Rollup merge of #141433 - compiler-errors:unsafe-binder-captures, r=oli-obk
Properly analyze captures from unsafe binders

We need to represent the unsafe binder unwrap as an adjustment in HIR. Pretty straightforward b/c we already represent it as a projection elem in MIR.

Fixes #141418
Fixes #141417

r? oli-obk
-rw-r--r--clippy_utils/src/sugg.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/clippy_utils/src/sugg.rs b/clippy_utils/src/sugg.rs
index 93dec113d31..f4dfc8f4b5a 100644
--- a/clippy_utils/src/sugg.rs
+++ b/clippy_utils/src/sugg.rs
@@ -941,6 +941,8 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
                         ProjectionKind::Subslice |
                         // Doesn't have surface syntax. Only occurs in patterns.
                         ProjectionKind::OpaqueCast => (),
+                        // Only occurs in closure captures.
+                        ProjectionKind::UnwrapUnsafeBinder => (),
                         ProjectionKind::Deref => {
                             // Explicit derefs are typically handled later on, but
                             // some items do not need explicit deref, such as array accesses,