about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-03-24 10:38:17 +0100
committerRalf Jung <post@ralfj.de>2023-03-24 10:38:17 +0100
commitb6495af39afb4618147636c1b6c4afba7751393f (patch)
tree5eadfa75cd98d2c9ca150c5401c0ae9c5694a692
parent95bb48667befb601df7bd1f00746873023a17fc5 (diff)
parent58eb9964cc627470cdd9fdcdef872a45615227fe (diff)
downloadrust-b6495af39afb4618147636c1b6c4afba7751393f.tar.gz
rust-b6495af39afb4618147636c1b6c4afba7751393f.zip
Merge from rustc
-rw-r--r--clippy_utils/src/qualify_min_const_fn.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs
index 24403e8b6f3..9f6adf3e3fa 100644
--- a/clippy_utils/src/qualify_min_const_fn.rs
+++ b/clippy_utils/src/qualify_min_const_fn.rs
@@ -37,7 +37,7 @@ pub fn is_min_const_fn<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, msrv: &Msrv)
                 | ty::PredicateKind::ConstEvaluatable(..)
                 | ty::PredicateKind::ConstEquate(..)
                 | ty::PredicateKind::TypeWellFormedFromEnv(..) => continue,
-                ty::PredicateKind::AliasEq(..) => panic!("alias eq predicate on function: {predicate:#?}"),
+                ty::PredicateKind::AliasRelate(..) => panic!("alias relate predicate on function: {predicate:#?}"),
                 ty::PredicateKind::ObjectSafe(_) => panic!("object safe predicate on function: {predicate:#?}"),
                 ty::PredicateKind::ClosureKind(..) => panic!("closure kind predicate on function: {predicate:#?}"),
                 ty::PredicateKind::Subtype(_) => panic!("subtype predicate on function: {predicate:#?}"),
@@ -176,6 +176,9 @@ fn check_rvalue<'tcx>(
             // FIXME(dyn-star)
             unimplemented!()
         },
+        Rvalue::Cast(CastKind::Transmute, _, _) => {
+            Err((span, "transmute can attempt to turn pointers into integers, so is unstable in const fn".into()))
+        },
         // binops are fine on integers
         Rvalue::BinaryOp(_, box (lhs, rhs)) | Rvalue::CheckedBinaryOp(_, box (lhs, rhs)) => {
             check_operand(tcx, lhs, span, body)?;