Skip to content

Commit 7467c3a

Browse files
s/const_effect/host_effect
1 parent f1bf874 commit 7467c3a

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl Qualif for NeedsNonConstDrop {
172172
destruct_def_id,
173173
[
174174
ty::GenericArg::from(ty),
175-
ty::GenericArg::from(cx.tcx.expected_const_effect_param_for_body(cx.def_id())),
175+
ty::GenericArg::from(cx.tcx.expected_host_effect_param_for_body(cx.def_id())),
176176
],
177177
),
178178
);

compiler/rustc_hir_typeck/src/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
780780
let generics = tcx.generics_of(callee_did);
781781
let Some(host_effect_index) = generics.host_effect_index else { return };
782782

783-
let effect = tcx.expected_const_effect_param_for_body(self.body_id);
783+
let effect = tcx.expected_host_effect_param_for_body(self.body_id);
784784

785785
trace!(?effect, ?generics, ?callee_args);
786786

compiler/rustc_middle/src/ty/util.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ impl<'tcx> TyCtxt<'tcx> {
782782
|| self.extern_crate(key.as_def_id()).is_some_and(|e| e.is_direct())
783783
}
784784

785-
pub fn expected_const_effect_param_for_body(self, def_id: LocalDefId) -> ty::Const<'tcx> {
785+
pub fn expected_host_effect_param_for_body(self, def_id: LocalDefId) -> ty::Const<'tcx> {
786786
// FIXME(effects): This is suspicious and should probably not be done,
787787
// especially now that we enforce host effects and then properly handle
788788
// effect vars during fallback.
@@ -817,7 +817,7 @@ impl<'tcx> TyCtxt<'tcx> {
817817
}
818818

819819
/// Constructs generic args for an item, optionally appending a const effect param type
820-
pub fn with_opt_const_effect_param(
820+
pub fn with_opt_host_effect_param(
821821
self,
822822
caller_def_id: LocalDefId,
823823
callee_def_id: DefId,
@@ -826,9 +826,10 @@ impl<'tcx> TyCtxt<'tcx> {
826826
let generics = self.generics_of(callee_def_id);
827827
assert_eq!(generics.parent, None);
828828

829-
let opt_const_param = generics.host_effect_index.is_some().then(|| {
830-
ty::GenericArg::from(self.expected_const_effect_param_for_body(caller_def_id))
831-
});
829+
let opt_const_param = generics
830+
.host_effect_index
831+
.is_some()
832+
.then(|| ty::GenericArg::from(self.expected_host_effect_param_for_body(caller_def_id)));
832833

833834
self.mk_args_from_iter(args.into_iter().map(|arg| arg.into()).chain(opt_const_param))
834835
}

compiler/rustc_mir_build/src/build/matches/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
500500
self.tcx,
501501
eq_def_id,
502502
sym::eq,
503-
self.tcx.with_opt_const_effect_param(self.def_id, eq_def_id, [ty, ty]),
503+
self.tcx.with_opt_host_effect_param(self.def_id, eq_def_id, [ty, ty]),
504504
);
505505

506506
let bool_ty = self.tcx.types.bool;

compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl<'tcx> ConstToPat<'tcx> {
272272
ty::TraitRef::new(
273273
tcx,
274274
partial_eq_trait_id,
275-
tcx.with_opt_const_effect_param(
275+
tcx.with_opt_host_effect_param(
276276
tcx.hir().enclosing_body_owner(self.id),
277277
partial_eq_trait_id,
278278
[ty, ty],

0 commit comments

Comments
 (0)