Skip to content

Commit f445077

Browse files
committed
Remove the no_force query attribute
1 parent cbce217 commit f445077

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

src/librustc/query/mod.rs

-38
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ rustc_queries! {
200200
// queries). Making it anonymous avoids hashing the result, which
201201
// may save a bit of time.
202202
anon
203-
no_force
204203
desc { "erasing regions from `{:?}`", ty }
205204
}
206205

@@ -209,7 +208,6 @@ rustc_queries! {
209208
}
210209

211210
query program_clauses_for_env(_: traits::Environment<'tcx>) -> Clauses<'tcx> {
212-
no_force
213211
desc { "generating chalk-style clauses for environment" }
214212
}
215213

@@ -252,7 +250,6 @@ rustc_queries! {
252250
/// To avoid cycles within the predicates of a single item we compute
253251
/// per-type-parameter predicates for resolving `T::AssocTy`.
254252
query type_param_predicates(key: (DefId, DefId)) -> ty::GenericPredicates<'tcx> {
255-
no_force
256253
desc { |tcx| "computing the bounds for type parameter `{}`", {
257254
let id = tcx.hir().as_local_hir_id(key.1).unwrap();
258255
tcx.hir().ty_param_name(id)
@@ -508,7 +505,6 @@ rustc_queries! {
508505
/// form to be used outside of const eval.
509506
query const_eval_raw(key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>)
510507
-> ConstEvalRawResult<'tcx> {
511-
no_force
512508
desc { |tcx|
513509
"const-evaluating `{}`",
514510
tcx.def_path_str(key.value.instance.def.def_id())
@@ -525,7 +521,6 @@ rustc_queries! {
525521
/// `tcx.const_eval_resolve`, `tcx.const_eval_instance`, or `tcx.const_eval_global_id`.
526522
query const_eval_validated(key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>)
527523
-> ConstEvalResult<'tcx> {
528-
no_force
529524
desc { |tcx|
530525
"const-evaluating + checking `{}`",
531526
tcx.def_path_str(key.value.instance.def.def_id())
@@ -540,7 +535,6 @@ rustc_queries! {
540535
query const_field(
541536
key: ty::ParamEnvAnd<'tcx, (&'tcx ty::Const<'tcx>, mir::Field)>
542537
) -> ConstValue<'tcx> {
543-
no_force
544538
desc { "extract field of const" }
545539
}
546540

@@ -549,19 +543,16 @@ rustc_queries! {
549543
query destructure_const(
550544
key: ty::ParamEnvAnd<'tcx, &'tcx ty::Const<'tcx>>
551545
) -> mir::DestructuredConst<'tcx> {
552-
no_force
553546
desc { "destructure constant" }
554547
}
555548

556549
query const_caller_location(key: (rustc_span::Symbol, u32, u32)) -> ConstValue<'tcx> {
557-
no_force
558550
desc { "get a &core::panic::Location referring to a span" }
559551
}
560552

561553
query lit_to_const(
562554
key: LitToConstInput<'tcx>
563555
) -> Result<&'tcx ty::Const<'tcx>, LitToConstError> {
564-
no_force
565556
desc { "converting literal to const" }
566557
}
567558
}
@@ -592,15 +583,13 @@ rustc_queries! {
592583
query region_scope_tree(_: DefId) -> &'tcx region::ScopeTree {}
593584

594585
query mir_shims(key: ty::InstanceDef<'tcx>) -> &'tcx mir::BodyAndCache<'tcx> {
595-
no_force
596586
desc { |tcx| "generating MIR shim for `{}`", tcx.def_path_str(key.def_id()) }
597587
}
598588

599589
/// The `symbol_name` query provides the symbol name for calling a
600590
/// given instance from the local crate. In particular, it will also
601591
/// look up the correct symbol name of instances from upstream crates.
602592
query symbol_name(key: ty::Instance<'tcx>) -> ty::SymbolName {
603-
no_force
604593
desc { "computing the symbol for `{}`", key }
605594
cache_on_disk_if { true }
606595
}
@@ -647,7 +636,6 @@ rustc_queries! {
647636
Other {
648637
query vtable_methods(key: ty::PolyTraitRef<'tcx>)
649638
-> &'tcx [Option<(DefId, SubstsRef<'tcx>)>] {
650-
no_force
651639
desc { |tcx| "finding all methods for trait {}", tcx.def_path_str(key.def_id()) }
652640
}
653641
}
@@ -656,7 +644,6 @@ rustc_queries! {
656644
query codegen_fulfill_obligation(
657645
key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)
658646
) -> Option<Vtable<'tcx, ()>> {
659-
no_force
660647
cache_on_disk_if { true }
661648
desc { |tcx|
662649
"checking if `{}` fulfills its obligations",
@@ -688,22 +675,18 @@ rustc_queries! {
688675
/// Trait selection queries. These are best used by invoking `ty.is_copy_modulo_regions()`,
689676
/// `ty.is_copy()`, etc, since that will prune the environment where possible.
690677
query is_copy_raw(env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool {
691-
no_force
692678
desc { "computing whether `{}` is `Copy`", env.value }
693679
}
694680
/// Query backing `TyS::is_sized`.
695681
query is_sized_raw(env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool {
696-
no_force
697682
desc { "computing whether `{}` is `Sized`", env.value }
698683
}
699684
/// Query backing `TyS::is_freeze`.
700685
query is_freeze_raw(env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool {
701-
no_force
702686
desc { "computing whether `{}` is freeze", env.value }
703687
}
704688
/// Query backing `TyS::needs_drop`.
705689
query needs_drop_raw(env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool {
706-
no_force
707690
desc { "computing whether `{}` needs drop", env.value }
708691
}
709692

@@ -717,7 +700,6 @@ rustc_queries! {
717700
query layout_raw(
718701
env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>
719702
) -> Result<&'tcx ty::layout::LayoutDetails, ty::layout::LayoutError<'tcx>> {
720-
no_force
721703
desc { "computing layout of `{}`", env.value }
722704
}
723705
}
@@ -773,7 +755,6 @@ rustc_queries! {
773755

774756
TypeChecking {
775757
query specializes(_: (DefId, DefId)) -> bool {
776-
no_force
777758
desc { "computing whether impls specialize one another" }
778759
}
779760
query in_scope_traits_map(_: DefIndex)
@@ -858,7 +839,6 @@ rustc_queries! {
858839
/// (like `Clone::clone` for example).
859840
query upstream_drop_glue_for(substs: SubstsRef<'tcx>) -> Option<CrateNum> {
860841
desc { "available upstream drop-glue for `{:?}`", substs }
861-
no_force
862842
}
863843
}
864844

@@ -903,7 +883,6 @@ rustc_queries! {
903883
TypeChecking {
904884
query implementations_of_trait(_: (CrateNum, DefId))
905885
-> &'tcx [DefId] {
906-
no_force
907886
desc { "looking up implementations of a trait in a crate" }
908887
}
909888
query all_trait_implementations(_: CrateNum)
@@ -1070,7 +1049,6 @@ rustc_queries! {
10701049
}
10711050
query is_codegened_item(_: DefId) -> bool {}
10721051
query codegen_unit(_: Symbol) -> Arc<CodegenUnit<'tcx>> {
1073-
no_force
10741052
desc { "codegen_unit" }
10751053
}
10761054
query backend_optimization_level(_: CrateNum) -> OptLevel {
@@ -1093,15 +1071,13 @@ rustc_queries! {
10931071
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, NormalizationResult<'tcx>>>,
10941072
NoSolution,
10951073
> {
1096-
no_force
10971074
desc { "normalizing `{:?}`", goal }
10981075
}
10991076

11001077
/// Do not call this query directly: invoke `normalize_erasing_regions` instead.
11011078
query normalize_ty_after_erasing_regions(
11021079
goal: ParamEnvAnd<'tcx, Ty<'tcx>>
11031080
) -> Ty<'tcx> {
1104-
no_force
11051081
desc { "normalizing `{:?}`", goal }
11061082
}
11071083

@@ -1111,7 +1087,6 @@ rustc_queries! {
11111087
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Vec<OutlivesBound<'tcx>>>>,
11121088
NoSolution,
11131089
> {
1114-
no_force
11151090
desc { "computing implied outlives bounds for `{:?}`", goal }
11161091
}
11171092

@@ -1122,7 +1097,6 @@ rustc_queries! {
11221097
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, DropckOutlivesResult<'tcx>>>,
11231098
NoSolution,
11241099
> {
1125-
no_force
11261100
desc { "computing dropck types for `{:?}`", goal }
11271101
}
11281102

@@ -1131,7 +1105,6 @@ rustc_queries! {
11311105
query evaluate_obligation(
11321106
goal: CanonicalPredicateGoal<'tcx>
11331107
) -> Result<traits::EvaluationResult, traits::OverflowError> {
1134-
no_force
11351108
desc { "evaluating trait selection obligation `{}`", goal.value.value }
11361109
}
11371110

@@ -1142,7 +1115,6 @@ rustc_queries! {
11421115
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
11431116
NoSolution,
11441117
> {
1145-
no_force
11461118
desc { "evaluating `type_op_ascribe_user_type` `{:?}`", goal }
11471119
}
11481120

@@ -1153,7 +1125,6 @@ rustc_queries! {
11531125
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
11541126
NoSolution,
11551127
> {
1156-
no_force
11571128
desc { "evaluating `type_op_eq` `{:?}`", goal }
11581129
}
11591130

@@ -1164,7 +1135,6 @@ rustc_queries! {
11641135
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
11651136
NoSolution,
11661137
> {
1167-
no_force
11681138
desc { "evaluating `type_op_subtype` `{:?}`", goal }
11691139
}
11701140

@@ -1175,7 +1145,6 @@ rustc_queries! {
11751145
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ()>>,
11761146
NoSolution,
11771147
> {
1178-
no_force
11791148
desc { "evaluating `type_op_prove_predicate` `{:?}`", goal }
11801149
}
11811150

@@ -1186,7 +1155,6 @@ rustc_queries! {
11861155
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, Ty<'tcx>>>,
11871156
NoSolution,
11881157
> {
1189-
no_force
11901158
desc { "normalizing `{:?}`", goal }
11911159
}
11921160

@@ -1197,7 +1165,6 @@ rustc_queries! {
11971165
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::Predicate<'tcx>>>,
11981166
NoSolution,
11991167
> {
1200-
no_force
12011168
desc { "normalizing `{:?}`", goal }
12021169
}
12031170

@@ -1208,7 +1175,6 @@ rustc_queries! {
12081175
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::PolyFnSig<'tcx>>>,
12091176
NoSolution,
12101177
> {
1211-
no_force
12121178
desc { "normalizing `{:?}`", goal }
12131179
}
12141180

@@ -1219,12 +1185,10 @@ rustc_queries! {
12191185
&'tcx Canonical<'tcx, canonical::QueryResponse<'tcx, ty::FnSig<'tcx>>>,
12201186
NoSolution,
12211187
> {
1222-
no_force
12231188
desc { "normalizing `{:?}`", goal }
12241189
}
12251190

12261191
query substitute_normalize_and_test_predicates(key: (DefId, SubstsRef<'tcx>)) -> bool {
1227-
no_force
12281192
desc { |tcx|
12291193
"testing substituted normalized predicates:`{}`",
12301194
tcx.def_path_str(key.0)
@@ -1234,7 +1198,6 @@ rustc_queries! {
12341198
query method_autoderef_steps(
12351199
goal: CanonicalTyGoal<'tcx>
12361200
) -> MethodAutoderefStepsResult<'tcx> {
1237-
no_force
12381201
desc { "computing autoderef types for `{:?}`", goal }
12391202
}
12401203
}
@@ -1248,7 +1211,6 @@ rustc_queries! {
12481211
// Get an estimate of the size of an InstanceDef based on its MIR for CGU partitioning.
12491212
query instance_def_size_estimate(def: ty::InstanceDef<'tcx>)
12501213
-> usize {
1251-
no_force
12521214
desc { |tcx| "estimating size for `{}`", tcx.def_path_str(def.def_id()) }
12531215
}
12541216

src/librustc_macros/src/query.rs

-16
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ enum QueryModifier {
5151
/// Don't hash the result, instead just mark a query red if it runs
5252
NoHash,
5353

54-
/// Don't force the query
55-
NoForce,
56-
5754
/// Generate a dep node based on the dependencies of the query
5855
Anon,
5956

@@ -118,8 +115,6 @@ impl Parse for QueryModifier {
118115
Ok(QueryModifier::CycleDelayBug)
119116
} else if modifier == "no_hash" {
120117
Ok(QueryModifier::NoHash)
121-
} else if modifier == "no_force" {
122-
Ok(QueryModifier::NoForce)
123118
} else if modifier == "anon" {
124119
Ok(QueryModifier::Anon)
125120
} else if modifier == "eval_always" {
@@ -222,9 +217,6 @@ struct QueryModifiers {
222217
/// Don't hash the result, instead just mark a query red if it runs
223218
no_hash: bool,
224219

225-
/// Don't force the query
226-
no_force: bool,
227-
228220
/// Generate a dep node based on the dependencies of the query
229221
anon: bool,
230222

@@ -241,7 +233,6 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers {
241233
let mut fatal_cycle = false;
242234
let mut cycle_delay_bug = false;
243235
let mut no_hash = false;
244-
let mut no_force = false;
245236
let mut anon = false;
246237
let mut eval_always = false;
247238
for modifier in query.modifiers.0.drain(..) {
@@ -288,12 +279,6 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers {
288279
}
289280
no_hash = true;
290281
}
291-
QueryModifier::NoForce => {
292-
if no_force {
293-
panic!("duplicate modifier `no_force` for query `{}`", query.name);
294-
}
295-
no_force = true;
296-
}
297282
QueryModifier::Anon => {
298283
if anon {
299284
panic!("duplicate modifier `anon` for query `{}`", query.name);
@@ -316,7 +301,6 @@ fn process_modifiers(query: &mut Query) -> QueryModifiers {
316301
fatal_cycle,
317302
cycle_delay_bug,
318303
no_hash,
319-
no_force,
320304
anon,
321305
eval_always,
322306
}

0 commit comments

Comments
 (0)