Skip to content

Commit b6495af

Browse files
committed
Merge from rustc
2 parents 95bb486 + 58eb996 commit b6495af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn is_min_const_fn<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, msrv: &Msrv)
3737
| ty::PredicateKind::ConstEvaluatable(..)
3838
| ty::PredicateKind::ConstEquate(..)
3939
| ty::PredicateKind::TypeWellFormedFromEnv(..) => continue,
40-
ty::PredicateKind::AliasEq(..) => panic!("alias eq predicate on function: {predicate:#?}"),
40+
ty::PredicateKind::AliasRelate(..) => panic!("alias relate predicate on function: {predicate:#?}"),
4141
ty::PredicateKind::ObjectSafe(_) => panic!("object safe predicate on function: {predicate:#?}"),
4242
ty::PredicateKind::ClosureKind(..) => panic!("closure kind predicate on function: {predicate:#?}"),
4343
ty::PredicateKind::Subtype(_) => panic!("subtype predicate on function: {predicate:#?}"),
@@ -176,6 +176,9 @@ fn check_rvalue<'tcx>(
176176
// FIXME(dyn-star)
177177
unimplemented!()
178178
},
179+
Rvalue::Cast(CastKind::Transmute, _, _) => {
180+
Err((span, "transmute can attempt to turn pointers into integers, so is unstable in const fn".into()))
181+
},
179182
// binops are fine on integers
180183
Rvalue::BinaryOp(_, box (lhs, rhs)) | Rvalue::CheckedBinaryOp(_, box (lhs, rhs)) => {
181184
check_operand(tcx, lhs, span, body)?;

0 commit comments

Comments
 (0)