Skip to content

Commit c63020a

Browse files
committed
rename codegen_fulfill_obligation
1 parent 14f2acd commit c63020a

File tree

7 files changed

+10
-15
lines changed

7 files changed

+10
-15
lines changed

compiler/rustc_middle/src/query/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1202,14 +1202,11 @@ rustc_queries! {
12021202
}
12031203
}
12041204

1205-
query codegen_fulfill_obligation(
1205+
query codegen_select_candidate(
12061206
key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)
12071207
) -> Result<&'tcx ImplSource<'tcx, ()>, traits::CodegenObligationError> {
12081208
cache_on_disk_if { true }
1209-
desc { |tcx|
1210-
"checking if `{}` fulfills its obligations",
1211-
tcx.def_path_str(key.1.def_id())
1212-
}
1209+
desc { |tcx| "computing candidate for `{}`", key.1 }
12131210
}
12141211

12151212
/// Return all `impl` blocks in the current crate.

compiler/rustc_middle/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ pub enum MethodViolationCode {
10241024
UndispatchableReceiver(Option<Span>),
10251025
}
10261026

1027-
/// These are the error cases for `codegen_fulfill_obligation`.
1027+
/// These are the error cases for `codegen_select_candidate`.
10281028
#[derive(Copy, Clone, Debug, Hash, HashStable, Encodable, Decodable)]
10291029
pub enum CodegenObligationError {
10301030
/// Ambiguity can happen when monomorphizing during trans

compiler/rustc_monomorphize/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn custom_coerce_unsize_info<'tcx>(
3535
substs: tcx.mk_substs_trait(source_ty, &[target_ty.into()]),
3636
});
3737

38-
match tcx.codegen_fulfill_obligation((ty::ParamEnv::reveal_all(), trait_ref)) {
38+
match tcx.codegen_select_candidate((ty::ParamEnv::reveal_all(), trait_ref)) {
3939
Ok(traits::ImplSource::UserDefined(traits::ImplSourceUserDefinedData {
4040
impl_def_id,
4141
..

compiler/rustc_trait_selection/src/traits/codegen.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_middle::ty::{self, TyCtxt};
1818
/// obligations *could be* resolved if we wanted to.
1919
///
2020
/// This also expects that `trait_ref` is fully normalized.
21-
pub fn codegen_fulfill_obligation<'tcx>(
21+
pub fn codegen_select_candidate<'tcx>(
2222
tcx: TyCtxt<'tcx>,
2323
(param_env, trait_ref): (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>),
2424
) -> Result<&'tcx ImplSource<'tcx, ()>, CodegenObligationError> {

compiler/rustc_trait_selection/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ pub fn provide(providers: &mut ty::query::Providers) {
971971
*providers = ty::query::Providers {
972972
specialization_graph_of: specialize::specialization_graph_provider,
973973
specializes: specialize::specializes,
974-
codegen_fulfill_obligation: codegen::codegen_fulfill_obligation,
974+
codegen_select_candidate: codegen::codegen_select_candidate,
975975
own_existential_vtable_entries,
976976
vtable_entries,
977977
vtable_trait_upcasting_coercion_new_vptr_slot,

compiler/rustc_ty_utils/src/instance.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ use rustc_hir::def_id::{DefId, LocalDefId};
33
use rustc_infer::infer::TyCtxtInferExt;
44
use rustc_middle::traits::CodegenObligationError;
55
use rustc_middle::ty::subst::SubstsRef;
6-
use rustc_middle::ty::{
7-
self, Instance, TyCtxt, TypeVisitable,
8-
};
6+
use rustc_middle::ty::{self, Instance, TyCtxt, TypeVisitable};
97
use rustc_span::{sym, DUMMY_SP};
108
use rustc_trait_selection::traits;
119
use traits::{translate_substs, Reveal};
@@ -101,7 +99,7 @@ fn resolve_associated_item<'tcx>(
10199

102100
let trait_ref = ty::TraitRef::from_method(tcx, trait_id, rcvr_substs);
103101

104-
let vtbl = match tcx.codegen_fulfill_obligation((param_env, ty::Binder::dummy(trait_ref))) {
102+
let vtbl = match tcx.codegen_select_candidate((param_env, ty::Binder::dummy(trait_ref))) {
105103
Ok(vtbl) => vtbl,
106104
Err(CodegenObligationError::Ambiguity) => {
107105
let reported = tcx.sess.delay_span_bug(

src/test/ui/const-generics/issues/issue-83765.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ error[E0391]: cycle detected when resolving instance `<LazyUpdim<T, { T::DIM },
44
LL | const DIM: usize;
55
| ^^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires checking if `TensorDimension` fulfills its obligations...
7+
note: ...which requires computing candidate for `<LazyUpdim<T, { T::DIM }, DIM> as TensorDimension>`...
88
--> $DIR/issue-83765.rs:4:1
99
|
1010
LL | trait TensorDimension {
1111
| ^^^^^^^^^^^^^^^^^^^^^
1212
= note: ...which again requires resolving instance `<LazyUpdim<T, { T::DIM }, DIM> as TensorDimension>::DIM`, completing the cycle
13-
note: cycle used when checking if `TensorDimension` fulfills its obligations
13+
note: cycle used when computing candidate for `<LazyUpdim<T, { T::DIM }, DIM> as TensorDimension>`
1414
--> $DIR/issue-83765.rs:4:1
1515
|
1616
LL | trait TensorDimension {

0 commit comments

Comments
 (0)