1
Fork 0

Make sure we can produce ConstArgHasWrongType errors for valtree consts

This commit is contained in:
Michael Goulet 2025-01-11 21:48:42 +00:00
parent 8c39ce5b4f
commit 516a93353d
4 changed files with 110 additions and 2 deletions

View file

@ -264,9 +264,10 @@ 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),
_ => span_bug!(
ty::ConstKind::Value(ty, _) => ty,
kind => span_bug!(
obligation.cause.span,
"ConstArgHasWrongType failed but we don't know how to compute type"
"ConstArgHasWrongType failed but we don't know how to compute type for {kind:?}"
),
};
FulfillmentErrorCode::Select(SelectionError::ConstArgHasWrongType {