1
Fork 0
This commit is contained in:
lcnr 2021-08-02 09:56:05 +02:00
parent bc0156bace
commit f3996f6a88
21 changed files with 62 additions and 40 deletions

View file

@ -391,7 +391,7 @@ fn orphan_check_trait_ref<'tcx>(
) -> Result<(), OrphanCheckErr<'tcx>> {
debug!("orphan_check_trait_ref(trait_ref={:?}, in_crate={:?})", trait_ref, in_crate);
if trait_ref.needs_infer() && trait_ref.needs_subst(tcx) {
if trait_ref.needs_infer() && trait_ref.definitely_needs_subst(tcx) {
bug!(
"can't orphan check a trait ref with both params and inference variables {:?}",
trait_ref

View file

@ -85,7 +85,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
let leaf = leaf.subst(tcx, ct.substs);
if leaf.has_infer_types_or_consts() {
failure_kind = FailureKind::MentionsInfer;
} else if leaf.has_param_types_or_consts(tcx) {
} else if leaf.definitely_has_param_types_or_consts(tcx) {
failure_kind = cmp::min(failure_kind, FailureKind::MentionsParam);
}
@ -95,7 +95,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
let ty = ty.subst(tcx, ct.substs);
if ty.has_infer_types_or_consts() {
failure_kind = FailureKind::MentionsInfer;
} else if ty.has_param_types_or_consts(tcx) {
} else if ty.definitely_has_param_types_or_consts(tcx) {
failure_kind = cmp::min(failure_kind, FailureKind::MentionsParam);
}
@ -151,7 +151,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
// See #74595 for more details about this.
let concrete = infcx.const_eval_resolve(param_env, uv.expand(), Some(span));
if concrete.is_ok() && uv.substs(infcx.tcx).has_param_types_or_consts(infcx.tcx) {
if concrete.is_ok() && uv.substs(infcx.tcx).definitely_has_param_types_or_consts(infcx.tcx) {
match infcx.tcx.def_kind(uv.def.did) {
DefKind::AnonConst => {
let mir_body = infcx.tcx.mir_for_ctfe_opt_const_arg(uv.def);

View file

@ -450,7 +450,7 @@ fn subst_and_check_impossible_predicates<'tcx>(
debug!("subst_and_check_impossible_predicates(key={:?})", key);
let mut predicates = tcx.predicates_of(key.0).instantiate(tcx, key.1).predicates;
predicates.retain(|predicate| !predicate.needs_subst(tcx));
predicates.retain(|predicate| !predicate.definitely_needs_subst(tcx));
let result = impossible_predicates(tcx, predicates);
debug!("subst_and_check_impossible_predicates(key={:?}) = {:?}", key, result);

View file

@ -696,7 +696,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
.param_env
.caller_bounds()
.iter()
.all(|bound| bound.needs_subst(self.tcx()))
.all(|bound| bound.definitely_needs_subst(self.tcx()))
{
// If a param env has no global bounds, global obligations do not
// depend on its particular value in order to work, so we can clear