Skip to content

Commit 4d735d8

Browse files
Begin to implement type system layer of unsafe binders
1 parent 54a396a commit 4d735d8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

clippy_lints/src/dereference.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,8 @@ impl TyCoercionStability {
877877
| ty::CoroutineClosure(..)
878878
| ty::Never
879879
| ty::Tuple(_)
880-
| ty::Alias(ty::Projection, _) => Self::Deref,
880+
| ty::Alias(ty::Projection, _)
881+
| ty::UnsafeBinder(_) => Self::Deref,
881882
};
882883
}
883884
}

clippy_utils/src/visitors.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,9 @@ pub fn for_each_unconsumed_temporary<'tcx, B>(
677677
ExprKind::Type(e, _) => {
678678
helper(typeck, consume, e, f)?;
679679
},
680+
ExprKind::UnsafeBinderCast(_, e, _) => {
681+
helper(typeck, consume, e, f)?;
682+
},
680683

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

0 commit comments

Comments
 (0)