Skip to content

Commit 6ce2273

Browse files
committed
Auto merge of #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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 3 additions & 3 deletions
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",

0 commit comments

Comments
 (0)