Skip to content

Commit 5fd3b26

Browse files
committed
rename prequery to try_fast_path
1 parent 0a0dae0 commit 5fd3b26

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/librustc/traits/query/type_op/eq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'tcx> Eq<'tcx> {
2727
impl<'gcx: 'tcx, 'tcx> super::QueryTypeOp<'gcx, 'tcx> for Eq<'tcx> {
2828
type QueryResult = ();
2929

30-
fn prequery(_tcx: TyCtxt<'_, 'gcx, 'tcx>, key: &ParamEnvAnd<'tcx, Eq<'tcx>>) -> Option<Self::QueryResult> {
30+
fn try_fast_path(_tcx: TyCtxt<'_, 'gcx, 'tcx>, key: &ParamEnvAnd<'tcx, Eq<'tcx>>) -> Option<Self::QueryResult> {
3131
if key.value.a == key.value.b {
3232
Some(())
3333
} else {

src/librustc/traits/query/type_op/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub trait QueryTypeOp<'gcx: 'tcx, 'tcx>:
4646
/// Either converts `self` directly into a `QueryResult` (for
4747
/// simple cases) or into a `QueryKey` (for more complex cases
4848
/// where we actually have work to do).
49-
fn prequery(
49+
fn try_fast_path(
5050
tcx: TyCtxt<'_, 'gcx, 'tcx>,
5151
key: &ParamEnvAnd<'tcx, Self>,
5252
) -> Option<Self::QueryResult>;
@@ -83,7 +83,7 @@ pub trait QueryTypeOp<'gcx: 'tcx, 'tcx>:
8383
infcx: &InferCtxt<'_, 'gcx, 'tcx>,
8484
output_query_region_constraints: &mut Vec<QueryRegionConstraint<'tcx>>,
8585
) -> Fallible<Self::QueryResult> {
86-
if let Some(result) = QueryTypeOp::prequery(infcx.tcx, &query_key) {
86+
if let Some(result) = QueryTypeOp::try_fast_path(infcx.tcx, &query_key) {
8787
return Ok(result);
8888
}
8989

src/librustc/traits/query/type_op/normalize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ where
3434
{
3535
type QueryResult = T;
3636

37-
fn prequery(_tcx: TyCtxt<'_, 'gcx, 'tcx>, key: &ParamEnvAnd<'tcx, Self>) -> Option<T> {
37+
fn try_fast_path(_tcx: TyCtxt<'_, 'gcx, 'tcx>, key: &ParamEnvAnd<'tcx, Self>) -> Option<T> {
3838
if !key.value.value.has_projections() {
3939
Some(key.value.value)
4040
} else {

src/librustc/traits/query/type_op/outlives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ where
3131
{
3232
type QueryResult = DropckOutlivesResult<'tcx>;
3333

34-
fn prequery(
34+
fn try_fast_path(
3535
tcx: TyCtxt<'_, 'gcx, 'tcx>,
3636
key: &ParamEnvAnd<'tcx, Self>,
3737
) -> Option<Self::QueryResult> {

src/librustc/traits/query/type_op/prove_predicate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<'tcx> ProvePredicate<'tcx> {
2828
impl<'gcx: 'tcx, 'tcx> super::QueryTypeOp<'gcx, 'tcx> for ProvePredicate<'tcx> {
2929
type QueryResult = ();
3030

31-
fn prequery(_tcx: TyCtxt<'_, 'gcx, 'tcx>, _key: &ParamEnvAnd<'tcx, Self>) -> Option<Self::QueryResult> {
31+
fn try_fast_path(_tcx: TyCtxt<'_, 'gcx, 'tcx>, _key: &ParamEnvAnd<'tcx, Self>) -> Option<Self::QueryResult> {
3232
None
3333
}
3434

src/librustc/traits/query/type_op/subtype.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl<'tcx> Subtype<'tcx> {
3030
impl<'gcx: 'tcx, 'tcx> super::QueryTypeOp<'gcx, 'tcx> for Subtype<'tcx> {
3131
type QueryResult = ();
3232

33-
fn prequery(_tcx: TyCtxt<'_, 'gcx, 'tcx>, key: &ParamEnvAnd<'tcx, Self>) -> Option<()> {
33+
fn try_fast_path(_tcx: TyCtxt<'_, 'gcx, 'tcx>, key: &ParamEnvAnd<'tcx, Self>) -> Option<()> {
3434
if key.value.sub == key.value.sup {
3535
Some(())
3636
} else {

0 commit comments

Comments
 (0)