Skip to content

Commit

Permalink
Auto merge of rust-lang#134625 - compiler-errors:unsafe-binders-ty, r…
Browse files Browse the repository at this point in the history
…=oli-obk

Begin to implement type system layer of unsafe binders

Mostly TODOs, but there's a lot of match arms that are basically just noops so I wanted to split these out before I put up the MIR lowering/projection part of this logic.

r? oli-obk

Tracking:

- rust-lang#130516
  • Loading branch information
bors committed Dec 24, 2024
2 parents c772140 + 4d735d8 commit b5fe6ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion clippy_lints/src/dereference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,8 @@ impl TyCoercionStability {
| ty::CoroutineClosure(..)
| ty::Never
| ty::Tuple(_)
| ty::Alias(ty::Projection, _) => Self::Deref,
| ty::Alias(ty::Projection, _)
| ty::UnsafeBinder(_) => Self::Deref,
};
}
}
Expand Down
4 changes: 3 additions & 1 deletion clippy_utils/src/visitors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,9 @@ pub fn for_each_unconsumed_temporary<'tcx, B>(
ExprKind::Type(e, _) => {
helper(typeck, consume, e, f)?;
},
ExprKind::UnsafeBinderCast(_, e, _) => {
helper(typeck, consume, e, f)?;
},

// Either drops temporaries, jumps out of the current expression, or has no sub expression.
ExprKind::DropTemps(_)
Expand All @@ -694,7 +697,6 @@ pub fn for_each_unconsumed_temporary<'tcx, B>(
| ExprKind::Continue(_)
| ExprKind::InlineAsm(_)
| ExprKind::OffsetOf(..)
| ExprKind::UnsafeBinderCast(..)
| ExprKind::Err(_) => (),
}
ControlFlow::Continue(())
Expand Down

0 comments on commit b5fe6ec

Please sign in to comment.