diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-12 23:18:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-12 23:18:54 +0100 |
| commit | cb0d74be28733e4d9bc8340be17087f5d2037d45 (patch) | |
| tree | f9498e501ea6b0437d6ea381f266c9143ac6246b /compiler/rustc_const_eval/src/interpret/util.rs | |
| parent | 15896bdd18dc0c5c450527d526427b637671caa7 (diff) | |
| parent | 8959434c70c2d3de86f5a1539792fa06de3c5715 (diff) | |
| download | rust-cb0d74be28733e4d9bc8340be17087f5d2037d45.tar.gz rust-cb0d74be28733e4d9bc8340be17087f5d2037d45.zip | |
Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obk
Dejargonize `subst` In favor of #110793, replace almost every occurence of `subst` and `substitution` from rustc codes, but they still remains in subtrees under `src/tools/` like clippy and test codes (I'd like to replace them after this)
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/util.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/util.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs index 52b79203d2b..3a9ee904734 100644 --- a/compiler/rustc_const_eval/src/interpret/util.rs +++ b/compiler/rustc_const_eval/src/interpret/util.rs @@ -19,11 +19,11 @@ where } struct FoundParam; - struct UsedParamsNeedSubstVisitor<'tcx> { + struct UsedParamsNeedInstantiationVisitor<'tcx> { tcx: TyCtxt<'tcx>, } - impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for UsedParamsNeedSubstVisitor<'tcx> { + impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for UsedParamsNeedInstantiationVisitor<'tcx> { type BreakTy = FoundParam; fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { @@ -39,17 +39,17 @@ where | ty::FnDef(def_id, args) => { let instance = ty::InstanceDef::Item(def_id); let unused_params = self.tcx.unused_generic_params(instance); - for (index, subst) in args.into_iter().enumerate() { + for (index, arg) in args.into_iter().enumerate() { let index = index .try_into() .expect("more generic parameters than can fit into a `u32`"); // Only recurse when generic parameters in fns, closures and coroutines // are used and have to be instantiated. // - // Just in case there are closures or coroutines within this subst, + // Just in case there are closures or coroutines within this arg, // recurse. - if unused_params.is_used(index) && subst.has_param() { - return subst.visit_with(self); + if unused_params.is_used(index) && arg.has_param() { + return arg.visit_with(self); } } ControlFlow::Continue(()) @@ -66,7 +66,7 @@ where } } - let mut vis = UsedParamsNeedSubstVisitor { tcx }; + let mut vis = UsedParamsNeedInstantiationVisitor { tcx }; if matches!(ty.visit_with(&mut vis), ControlFlow::Break(FoundParam)) { throw_inval!(TooGeneric); } else { |
