introduce ty::Value
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
This commit is contained in:
parent
5a45ab9738
commit
10fc0b159e
44 changed files with 214 additions and 205 deletions
|
@ -264,7 +264,7 @@ fn fulfillment_error_for_no_solution<'tcx>(
|
|||
infcx.tcx.type_of(uv.def).instantiate(infcx.tcx, uv.args)
|
||||
}
|
||||
ty::ConstKind::Param(param_ct) => param_ct.find_ty_from_env(obligation.param_env),
|
||||
ty::ConstKind::Value(ty, _) => ty,
|
||||
ty::ConstKind::Value(cv) => cv.ty,
|
||||
kind => span_bug!(
|
||||
obligation.cause.span,
|
||||
"ConstArgHasWrongType failed but we don't know how to compute type for {kind:?}"
|
||||
|
|
|
@ -35,7 +35,7 @@ pub fn is_const_evaluatable<'tcx>(
|
|||
ty::ConstKind::Param(_)
|
||||
| ty::ConstKind::Bound(_, _)
|
||||
| ty::ConstKind::Placeholder(_)
|
||||
| ty::ConstKind::Value(_, _)
|
||||
| ty::ConstKind::Value(_)
|
||||
| ty::ConstKind::Error(_) => return Ok(()),
|
||||
ty::ConstKind::Infer(_) => return Err(NotConstEvaluatable::MentionsInfer),
|
||||
};
|
||||
|
|
|
@ -479,7 +479,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
|
|||
ty::ConstKind::Error(_) => {
|
||||
return ProcessResult::Changed(PendingPredicateObligations::new());
|
||||
}
|
||||
ty::ConstKind::Value(ty, _) => ty,
|
||||
ty::ConstKind::Value(cv) => cv.ty,
|
||||
ty::ConstKind::Unevaluated(uv) => {
|
||||
infcx.tcx.type_of(uv.def).instantiate(infcx.tcx, uv.args)
|
||||
}
|
||||
|
|
|
@ -962,7 +962,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
return Ok(EvaluatedToAmbig);
|
||||
}
|
||||
ty::ConstKind::Error(_) => return Ok(EvaluatedToOk),
|
||||
ty::ConstKind::Value(ty, _) => ty,
|
||||
ty::ConstKind::Value(cv) => cv.ty,
|
||||
ty::ConstKind::Unevaluated(uv) => {
|
||||
self.tcx().type_of(uv.def).instantiate(self.tcx(), uv.args)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue