Rollup merge of #142927 - compiler-errors:note-find-const, r=BoxyUwU
Add note to `find_const_ty_from_env` Add a note to `find_const_ty_from_env` to explain why it has an `unwrap` which "often" causes ICEs. Also, uplift it into the new trait solver. This avoids needing to go through the interner to call this method which is otherwise an inherent method in the compiler. I can remove this part if desired. r? `@boxyuwu`
This commit is contained in:
@@ -37,7 +37,9 @@ pub(super) fn fulfillment_error_for_no_solution<'tcx>(
|
||||
ty::ConstKind::Unevaluated(uv) => {
|
||||
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::Param(param_ct) => {
|
||||
param_ct.find_const_ty_from_env(obligation.param_env)
|
||||
}
|
||||
ty::ConstKind::Value(cv) => cv.ty,
|
||||
kind => span_bug!(
|
||||
obligation.cause.span,
|
||||
|
||||
Reference in New Issue
Block a user