Skip to content

Commit e666032

Browse files
committed
bound variables during ctfe are a bug
1 parent d15b00a commit e666032

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
7979
ty::Projection(_)
8080
| ty::Opaque(_, _)
8181
| ty::Param(_)
82-
| ty::Bound(_, _)
8382
| ty::Placeholder(_)
8483
| ty::Infer(_) => throw_inval!(TooGeneric),
84+
ty::Bound(_, _) => bug!("bound ty during ctfe"),
8585
ty::Bool
8686
| ty::Char
8787
| ty::Int(_)

compiler/rustc_const_eval/src/interpret/operand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,15 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
559559
layout: Option<TyAndLayout<'tcx>>,
560560
) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
561561
match c.kind() {
562-
ty::ConstKind::Param(_) | ty::ConstKind::Bound(..) => throw_inval!(TooGeneric),
562+
ty::ConstKind::Param(_) | ty::ConstKind::Placeholder(..) => throw_inval!(TooGeneric),
563563
ty::ConstKind::Error(DelaySpanBugEmitted { reported, .. }) => {
564564
throw_inval!(AlreadyReported(reported))
565565
}
566566
ty::ConstKind::Unevaluated(uv) => {
567567
let instance = self.resolve(uv.def, uv.substs)?;
568568
Ok(self.eval_to_allocation(GlobalId { instance, promoted: uv.promoted })?.into())
569569
}
570-
ty::ConstKind::Infer(..) | ty::ConstKind::Placeholder(..) => {
570+
ty::ConstKind::Bound(..) | ty::ConstKind::Infer(..) => {
571571
span_bug!(self.cur_span(), "const_to_op: Unexpected ConstKind {:?}", c)
572572
}
573573
ty::ConstKind::Value(valtree) => {

0 commit comments

Comments
 (0)