Skip to content

Commit 6ce2273

Browse files
committed
Auto merge of rust-lang#110882 - BoxyUwU:rename-some-ty-flags, r=compiler-errors
rename `NEEDS_SUBST` and `NEEDS_INFER` implements rust-lang/compiler-team#617
2 parents 8b8110e + 8424197 commit 6ce2273

File tree

46 files changed

+86
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+86
-85
lines changed

compiler/rustc_codegen_cranelift/src/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub(crate) fn get_function_sig<'tcx>(
7070
default_call_conv: CallConv,
7171
inst: Instance<'tcx>,
7272
) -> Signature {
73-
assert!(!inst.substs.needs_infer());
73+
assert!(!inst.substs.has_infer());
7474
clif_sig_from_fn_abi(
7575
tcx,
7676
default_call_conv,

compiler/rustc_codegen_cranelift/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub(crate) fn codegen_fn<'tcx>(
2828
module: &mut dyn Module,
2929
instance: Instance<'tcx>,
3030
) -> CodegenedFunction {
31-
debug_assert!(!instance.substs.needs_infer());
31+
debug_assert!(!instance.substs.has_infer());
3232

3333
let symbol_name = tcx.symbol_name(instance).name.to_string();
3434
let _timer = tcx.prof.generic_activity_with_arg("codegen fn", &*symbol_name);

compiler/rustc_codegen_gcc/src/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::context::CodegenCx;
1717
pub fn get_fn<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, instance: Instance<'tcx>) -> Function<'gcc> {
1818
let tcx = cx.tcx();
1919

20-
assert!(!instance.substs.needs_infer());
20+
assert!(!instance.substs.has_infer());
2121
assert!(!instance.substs.has_escaping_bound_vars());
2222

2323
let sym = tcx.symbol_name(instance).name;

compiler/rustc_codegen_gcc/src/mono_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'gcc, 'tcx> PreDefineMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
3131

3232
#[cfg_attr(not(feature="master"), allow(unused_variables))]
3333
fn predefine_fn(&self, instance: Instance<'tcx>, linkage: Linkage, visibility: Visibility, symbol_name: &str) {
34-
assert!(!instance.substs.needs_infer());
34+
assert!(!instance.substs.has_infer());
3535

3636
let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty());
3737
self.linkage.set(base::linkage_to_gcc(linkage));

compiler/rustc_codegen_llvm/src/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) ->
2727

2828
debug!("get_fn(instance={:?})", instance);
2929

30-
assert!(!instance.substs.needs_infer());
30+
assert!(!instance.substs.has_infer());
3131
assert!(!instance.substs.has_escaping_bound_vars());
3232

3333
if let Some(&llfn) = cx.instances.borrow().get(&instance) {

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ impl<'ll, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
515515
ty::Adt(def, ..) if !def.is_box() => {
516516
// Again, only create type information if full debuginfo is enabled
517517
if cx.sess().opts.debuginfo == DebugInfo::Full
518-
&& !impl_self_ty.needs_subst()
518+
&& !impl_self_ty.has_param()
519519
{
520520
Some(type_di_node(cx, impl_self_ty))
521521
} else {

compiler/rustc_codegen_llvm/src/mono_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'_, 'tcx> {
4848
visibility: Visibility,
4949
symbol_name: &str,
5050
) {
51-
assert!(!instance.substs.needs_infer());
51+
assert!(!instance.substs.has_infer());
5252

5353
let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty());
5454
let lldecl = self.declare_fn(symbol_name, fn_abi);

compiler/rustc_codegen_ssa/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
152152
cx: &'a Bx::CodegenCx,
153153
instance: Instance<'tcx>,
154154
) {
155-
assert!(!instance.substs.needs_infer());
155+
assert!(!instance.substs.has_infer());
156156

157157
let llfn = cx.get_fn(instance);
158158

compiler/rustc_const_eval/src/interpret/util.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ where
1414
T: TypeVisitable<TyCtxt<'tcx>>,
1515
{
1616
debug!("ensure_monomorphic_enough: ty={:?}", ty);
17-
if !ty.needs_subst() {
17+
if !ty.has_param() {
1818
return Ok(());
1919
}
2020

@@ -27,7 +27,7 @@ where
2727
type BreakTy = FoundParam;
2828

2929
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
30-
if !ty.needs_subst() {
30+
if !ty.has_param() {
3131
return ControlFlow::Continue(());
3232
}
3333

@@ -46,7 +46,7 @@ where
4646
// are used and require substitution.
4747
// Just in case there are closures or generators within this subst,
4848
// recurse.
49-
if unused_params.is_used(index) && subst.needs_subst() {
49+
if unused_params.is_used(index) && subst.has_param() {
5050
return subst.visit_with(self);
5151
}
5252
}

compiler/rustc_hir_analysis/src/astconv/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
23182318
let infcx = match self.infcx() {
23192319
Some(infcx) => infcx,
23202320
None => {
2321-
assert!(!self_ty.needs_infer());
2321+
assert!(!self_ty.has_infer());
23222322
infcx_ = tcx.infer_ctxt().ignoring_regions().build();
23232323
&infcx_
23242324
}
@@ -2489,7 +2489,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
24892489
let infcx = if let Some(infcx) = self.infcx() {
24902490
infcx
24912491
} else {
2492-
assert!(!qself_ty.needs_infer());
2492+
assert!(!qself_ty.has_infer());
24932493
infcx_ = tcx.infer_ctxt().build();
24942494
&infcx_
24952495
};
@@ -3039,7 +3039,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
30393039
// the anon const, which is empty. This is why the
30403040
// `AlwaysApplicable` impl needs a `T: ?Sized` bound for
30413041
// this to compile if we were to normalize here.
3042-
if forbid_generic && ty.needs_subst() {
3042+
if forbid_generic && ty.has_param() {
30433043
let mut err = tcx.sess.struct_span_err(
30443044
path.span,
30453045
"generic `Self` types are currently not permitted in anonymous constants",

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ fn check_type_defn<'tcx>(tcx: TyCtxt<'tcx>, item: &hir::Item<'tcx>, all_sized: b
10271027
packed && {
10281028
let ty = tcx.type_of(variant.fields.raw.last().unwrap().did).subst_identity();
10291029
let ty = tcx.erase_regions(ty);
1030-
if ty.needs_infer() {
1030+
if ty.has_infer() {
10311031
tcx.sess
10321032
.delay_span_bug(item.span, &format!("inference variables in {:?}", ty));
10331033
// Just treat unresolved type expression as if it needs drop.
@@ -1292,7 +1292,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
12921292
// Ignore dependent defaults -- that is, where the default of one type
12931293
// parameter includes another (e.g., `<T, U = T>`). In those cases, we can't
12941294
// be sure if it will error or not as user might always specify the other.
1295-
if !ty.needs_subst() {
1295+
if !ty.has_param() {
12961296
wfcx.register_wf_obligation(
12971297
tcx.def_span(param.def_id),
12981298
Some(WellFormedLoc::Ty(param.def_id.expect_local())),
@@ -1308,7 +1308,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
13081308
// for `struct Foo<const N: usize, const M: usize = { 1 - 2 }>`
13091309
// we should eagerly error.
13101310
let default_ct = tcx.const_param_default(param.def_id).subst_identity();
1311-
if !default_ct.needs_subst() {
1311+
if !default_ct.has_param() {
13121312
wfcx.register_wf_obligation(
13131313
tcx.def_span(param.def_id),
13141314
None,
@@ -1342,7 +1342,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
13421342
if is_our_default(param) {
13431343
let default_ty = tcx.type_of(param.def_id).subst_identity();
13441344
// ... and it's not a dependent default, ...
1345-
if !default_ty.needs_subst() {
1345+
if !default_ty.has_param() {
13461346
// ... then substitute it with the default.
13471347
return default_ty.into();
13481348
}
@@ -1355,7 +1355,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
13551355
if is_our_default(param) {
13561356
let default_ct = tcx.const_param_default(param.def_id).subst_identity();
13571357
// ... and it's not a dependent default, ...
1358-
if !default_ct.needs_subst() {
1358+
if !default_ct.has_param() {
13591359
// ... then substitute it with the default.
13601360
return default_ct.into();
13611361
}

compiler/rustc_hir_analysis/src/coherence/orphan.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ fn emit_newtype_suggestion_for_raw_ptr(
457457
ptr_ty: &ty::TypeAndMut<'_>,
458458
diag: &mut Diagnostic,
459459
) {
460-
if !self_ty.needs_subst() {
460+
if !self_ty.has_param() {
461461
let mut_key = ptr_ty.mutbl.prefix_str();
462462
let msg_sugg = "consider introducing a new wrapper type".to_owned();
463463
let sugg = vec![

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ fn check_predicates<'tcx>(
366366
wf::obligations(infcx, tcx.param_env(impl1_def_id), impl1_def_id, 0, arg, span)
367367
.unwrap();
368368

369-
assert!(!obligations.needs_infer());
369+
assert!(!obligations.has_infer());
370370
impl2_predicates
371371
.extend(traits::elaborate(tcx, obligations).map(|obligation| obligation.predicate))
372372
}

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
168168
ocx.normalize(&ObligationCause::dummy(), self.param_env, fn_sig);
169169
if ocx.select_all_or_error().is_empty() {
170170
let normalized_fn_sig = self.resolve_vars_if_possible(normalized_fn_sig);
171-
if !normalized_fn_sig.needs_infer() {
171+
if !normalized_fn_sig.has_infer() {
172172
return normalized_fn_sig;
173173
}
174174
}

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13841384
}
13851385
let item_ty = self.tcx.type_of(item.def_id).subst_identity();
13861386
// FIXME(compiler-errors): This check is *so* rudimentary
1387-
if item_ty.needs_subst() {
1387+
if item_ty.has_param() {
13881388
return false;
13891389
}
13901390
if self.can_coerce(item_ty, expected_ty) {

compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/record_consumed_borrow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
202202
// If the type being assigned needs dropped, then the mutation counts as a borrow
203203
// since it is essentially doing `Drop::drop(&mut x); x = new_value;`.
204204
let ty = self.tcx.erase_regions(assignee_place.place.base_ty);
205-
if ty.needs_infer() {
205+
if ty.has_infer() {
206206
self.tcx.sess.delay_span_bug(
207207
self.tcx.hir().span(assignee_place.hir_id),
208208
&format!("inference variables in {ty}"),

compiler/rustc_hir_typeck/src/generator_interior/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
460460
// Avoid ICEs in needs_drop.
461461
let ty = self.fcx.resolve_vars_if_possible(ty);
462462
let ty = self.fcx.tcx.erase_regions(ty);
463-
if ty.needs_infer() {
463+
if ty.has_infer() {
464464
self.fcx
465465
.tcx
466466
.sess

compiler/rustc_hir_typeck/src/method/probe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ impl<'tcx> Candidate<'tcx> {
20322032
// means they are safe to put into the
20332033
// `WhereClausePick`.
20342034
assert!(
2035-
!trait_ref.skip_binder().substs.needs_infer()
2035+
!trait_ref.skip_binder().substs.has_infer()
20362036
&& !trait_ref.skip_binder().substs.has_placeholders()
20372037
);
20382038

compiler/rustc_hir_typeck/src/writeback.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
133133

134134
fn write_ty_to_typeck_results(&mut self, hir_id: hir::HirId, ty: Ty<'tcx>) {
135135
debug!("write_ty_to_typeck_results({:?}, {:?})", hir_id, ty);
136-
assert!(!ty.needs_infer() && !ty.has_placeholders() && !ty.has_free_regions());
136+
assert!(!ty.has_infer() && !ty.has_placeholders() && !ty.has_free_regions());
137137
self.typeck_results.node_types_mut().insert(hir_id, ty);
138138
}
139139

@@ -508,7 +508,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
508508
fcx_typeck_results.user_provided_types().items().map(|(local_id, c_ty)| {
509509
let hir_id = hir::HirId { owner: common_hir_owner, local_id };
510510

511-
if cfg!(debug_assertions) && c_ty.needs_infer() {
511+
if cfg!(debug_assertions) && c_ty.has_infer() {
512512
span_bug!(
513513
hir_id.to_span(self.fcx.tcx),
514514
"writeback: `{:?}` has inference variables",
@@ -527,7 +527,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
527527

528528
self.typeck_results.user_provided_sigs.extend(
529529
fcx_typeck_results.user_provided_sigs.items().map(|(&def_id, c_sig)| {
530-
if cfg!(debug_assertions) && c_sig.needs_infer() {
530+
if cfg!(debug_assertions) && c_sig.has_infer() {
531531
span_bug!(
532532
self.fcx.tcx.def_span(def_id),
533533
"writeback: `{:?}` has inference variables",
@@ -618,7 +618,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
618618
if let Some(substs) = self.fcx.typeck_results.borrow().node_substs_opt(hir_id) {
619619
let substs = self.resolve(substs, &span);
620620
debug!("write_substs_to_tcx({:?}, {:?})", hir_id, substs);
621-
assert!(!substs.needs_infer() && !substs.has_placeholders());
621+
assert!(!substs.has_infer() && !substs.has_placeholders());
622622
self.typeck_results.node_substs_mut().insert(hir_id, substs);
623623
}
624624
}
@@ -693,7 +693,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
693693
{
694694
let hir_id = hir::HirId { owner: common_hir_owner, local_id };
695695

696-
if cfg!(debug_assertions) && container.needs_infer() {
696+
if cfg!(debug_assertions) && container.has_infer() {
697697
span_bug!(
698698
hir_id.to_span(self.fcx.tcx),
699699
"writeback: `{:?}` has inference variables",
@@ -711,7 +711,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
711711
{
712712
let mut resolver = Resolver::new(self.fcx, span, self.body);
713713
let x = x.fold_with(&mut resolver);
714-
if cfg!(debug_assertions) && x.needs_infer() {
714+
if cfg!(debug_assertions) && x.has_infer() {
715715
span_bug!(span.to_span(self.fcx.tcx), "writeback: `{:?}` has inference variables", x);
716716
}
717717

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -564,12 +564,12 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
564564
let _inside_canonical_ctxt_guard = infcx.set_canonicalization_ctxt();
565565

566566
let needs_canonical_flags = if canonicalize_region_mode.any() {
567-
TypeFlags::NEEDS_INFER |
567+
TypeFlags::HAS_INFER |
568568
TypeFlags::HAS_FREE_REGIONS | // `HAS_RE_PLACEHOLDER` implies `HAS_FREE_REGIONS`
569569
TypeFlags::HAS_TY_PLACEHOLDER |
570570
TypeFlags::HAS_CT_PLACEHOLDER
571571
} else {
572-
TypeFlags::NEEDS_INFER
572+
TypeFlags::HAS_INFER
573573
| TypeFlags::HAS_RE_PLACEHOLDER
574574
| TypeFlags::HAS_TY_PLACEHOLDER
575575
| TypeFlags::HAS_CT_PLACEHOLDER
@@ -600,7 +600,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
600600
// Once we have canonicalized `out_value`, it should not
601601
// contain anything that ties it to this inference context
602602
// anymore.
603-
debug_assert!(!out_value.needs_infer() && !out_value.has_placeholders());
603+
debug_assert!(!out_value.has_infer() && !out_value.has_placeholders());
604604

605605
let canonical_variables =
606606
tcx.mk_canonical_var_infos(&canonicalizer.universe_canonicalized_variables());

compiler/rustc_infer/src/infer/freshen.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for TypeFreshener<'a, 'tcx> {
127127

128128
#[inline]
129129
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
130-
if !t.needs_infer() && !t.has_erasable_regions() {
130+
if !t.has_infer() && !t.has_erasable_regions() {
131131
t
132132
} else {
133133
match *t.kind() {

compiler/rustc_infer/src/infer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ impl<'tcx> InferCtxt<'tcx> {
13271327
where
13281328
T: TypeFoldable<TyCtxt<'tcx>>,
13291329
{
1330-
if !value.needs_infer() {
1330+
if !value.has_infer() {
13311331
return value; // Avoid duplicated subst-folding.
13321332
}
13331333
let mut r = InferenceLiteralEraser { tcx: self.tcx };
@@ -1365,7 +1365,7 @@ impl<'tcx> InferCtxt<'tcx> {
13651365
pub fn fully_resolve<T: TypeFoldable<TyCtxt<'tcx>>>(&self, value: T) -> FixupResult<'tcx, T> {
13661366
let value = resolve::fully_resolve(self, value);
13671367
assert!(
1368-
value.as_ref().map_or(true, |value| !value.needs_infer()),
1368+
value.as_ref().map_or(true, |value| !value.has_infer()),
13691369
"`{value:?}` is not fully resolved"
13701370
);
13711371
value

compiler/rustc_infer/src/infer/outlives/obligations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ where
347347
let is_opaque = alias_ty.kind(self.tcx) == ty::Opaque;
348348
if approx_env_bounds.is_empty()
349349
&& trait_bounds.is_empty()
350-
&& (alias_ty.needs_infer() || is_opaque)
350+
&& (alias_ty.has_infer() || is_opaque)
351351
{
352352
debug!("no declared bounds");
353353
let opt_variances = is_opaque.then(|| self.tcx.variances_of(alias_ty.def_id));

compiler/rustc_infer/src/infer/resolve.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<'a, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for FullTypeResolver<'a, 'tcx> {
213213
}
214214

215215
fn try_fold_ty(&mut self, t: Ty<'tcx>) -> Result<Ty<'tcx>, Self::Error> {
216-
if !t.needs_infer() {
216+
if !t.has_infer() {
217217
Ok(t) // micro-optimize -- if there is nothing in this type that this fold affects...
218218
} else {
219219
let t = self.infcx.shallow_resolve(t);
@@ -243,7 +243,7 @@ impl<'a, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for FullTypeResolver<'a, 'tcx> {
243243
}
244244

245245
fn try_fold_const(&mut self, c: ty::Const<'tcx>) -> Result<ty::Const<'tcx>, Self::Error> {
246-
if !c.needs_infer() {
246+
if !c.has_infer() {
247247
Ok(c) // micro-optimize -- if there is nothing in this const that this fold affects...
248248
} else {
249249
let c = self.infcx.shallow_resolve(c);

compiler/rustc_lint/src/enum_intrinsics_non_enums.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ declare_lint_pass!(EnumIntrinsicsNonEnums => [ENUM_INTRINSICS_NON_ENUMS]);
4242
/// Returns `true` if we know for sure that the given type is not an enum. Note that for cases where
4343
/// the type is generic, we can't be certain if it will be an enum so we have to assume that it is.
4444
fn is_non_enum(t: Ty<'_>) -> bool {
45-
!t.is_enum() && !t.needs_subst()
45+
!t.is_enum() && !t.has_param()
4646
}
4747

4848
fn enforce_mem_discriminant(

compiler/rustc_middle/src/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl<'tcx> CtxtInterners<'tcx> {
215215
) -> Fingerprint {
216216
// It's impossible to hash inference variables (and will ICE), so we don't need to try to cache them.
217217
// Without incremental, we rarely stable-hash types, so let's not do it proactively.
218-
if flags.flags.intersects(TypeFlags::NEEDS_INFER) || sess.opts.incremental.is_none() {
218+
if flags.flags.intersects(TypeFlags::HAS_INFER) || sess.opts.incremental.is_none() {
219219
Fingerprint::ZERO
220220
} else {
221221
let mut hasher = StableHasher::new();

compiler/rustc_middle/src/ty/erase_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RegionEraserVisitor<'tcx> {
4040
}
4141

4242
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
43-
if ty.needs_infer() { ty.super_fold_with(self) } else { self.tcx.erase_regions_ty(ty) }
43+
if ty.has_infer() { ty.super_fold_with(self) } else { self.tcx.erase_regions_ty(ty) }
4444
}
4545

4646
fn fold_binder<T>(&mut self, t: ty::Binder<'tcx, T>) -> ty::Binder<'tcx, T>

0 commit comments

Comments
 (0)