3232//! - `arena_cache`: Use an arena for in-memory caching of the query result.
3333//! - `cache_on_disk_if { ... }`: Cache the query result to disk if the provided block evaluates to
3434//! true. The query key identifier is available for use within the block, as is `tcx`.
35- //! - `cycle_fatal`: If a dependency cycle is detected, abort compilation with a fatal error.
3635//! - `cycle_delay_bug`: If a dependency cycle is detected, emit a delayed bug instead of aborting immediately.
3736//! - `cycle_stash`: If a dependency cycle is detected, stash the error for later handling.
3837//! - `no_hash`: Do not hash the query result for incremental compilation; just mark as dirty if recomputed.
@@ -149,11 +148,11 @@ use crate::{dep_graph, mir, thir};
149148// which memoizes and does dep-graph tracking, wrapping around the actual
150149// `Providers` that the driver creates (using several `rustc_*` crates).
151150//
152- // The result type of each query must implement `Clone`, and additionally
153- // `ty::query::from_cycle_error::FromCycleError`, which produces an appropriate
151+ // The result type of each query must implement `Clone`. Additionally
152+ // `ty::query::from_cycle_error::FromCycleError` can be implemented which produces an appropriate
154153// placeholder (error) value if the query resulted in a query cycle.
155- // Queries marked with `cycle_fatal` do not need the latter implementation,
156- // as they will raise a fatal error on query cycles instead.
154+ // Queries without a `FromCycleError` implementation will raise a fatal error on query
155+ // cycles instead.
157156rustc_queries ! {
158157 /// Caches the expansion of a derive proc macro, e.g. `#[derive(Serialize)]`.
159158 /// The key is:
@@ -587,7 +586,6 @@ rustc_queries! {
587586 }
588587
589588 query is_panic_runtime( _: CrateNum ) -> bool {
590- cycle_fatal
591589 desc { "checking if the crate is_panic_runtime" }
592590 separate_provide_extern
593591 }
@@ -1323,7 +1321,6 @@ rustc_queries! {
13231321 /// Return the set of (transitive) callees that may result in a recursive call to `key`,
13241322 /// if we were able to walk all callees.
13251323 query mir_callgraph_cyclic( key: LocalDefId ) -> & ' tcx Option <UnordSet <LocalDefId >> {
1326- cycle_fatal
13271324 arena_cache
13281325 desc {
13291326 "computing (transitive) callees of `{}` that may recurse" ,
@@ -1334,7 +1331,6 @@ rustc_queries! {
13341331
13351332 /// Obtain all the calls into other local functions
13361333 query mir_inliner_callees( key: ty:: InstanceKind <' tcx>) -> & ' tcx [ ( DefId , GenericArgsRef <' tcx>) ] {
1337- cycle_fatal
13381334 desc {
13391335 "computing all local function calls in `{}`" ,
13401336 tcx. def_path_str( key. def_id( ) ) ,
@@ -1829,31 +1825,26 @@ rustc_queries! {
18291825 }
18301826
18311827 query is_compiler_builtins( _: CrateNum ) -> bool {
1832- cycle_fatal
18331828 desc { "checking if the crate is_compiler_builtins" }
18341829 separate_provide_extern
18351830 }
18361831 query has_global_allocator( _: CrateNum ) -> bool {
18371832 // This query depends on untracked global state in CStore
18381833 eval_always
1839- cycle_fatal
18401834 desc { "checking if the crate has_global_allocator" }
18411835 separate_provide_extern
18421836 }
18431837 query has_alloc_error_handler( _: CrateNum ) -> bool {
18441838 // This query depends on untracked global state in CStore
18451839 eval_always
1846- cycle_fatal
18471840 desc { "checking if the crate has_alloc_error_handler" }
18481841 separate_provide_extern
18491842 }
18501843 query has_panic_handler( _: CrateNum ) -> bool {
1851- cycle_fatal
18521844 desc { "checking if the crate has_panic_handler" }
18531845 separate_provide_extern
18541846 }
18551847 query is_profiler_runtime( _: CrateNum ) -> bool {
1856- cycle_fatal
18571848 desc { "checking if a crate is `#![profiler_runtime]`" }
18581849 separate_provide_extern
18591850 }
@@ -1862,22 +1853,18 @@ rustc_queries! {
18621853 cache_on_disk_if { true }
18631854 }
18641855 query required_panic_strategy( _: CrateNum ) -> Option <PanicStrategy > {
1865- cycle_fatal
18661856 desc { "getting a crate's required panic strategy" }
18671857 separate_provide_extern
18681858 }
18691859 query panic_in_drop_strategy( _: CrateNum ) -> PanicStrategy {
1870- cycle_fatal
18711860 desc { "getting a crate's configured panic-in-drop strategy" }
18721861 separate_provide_extern
18731862 }
18741863 query is_no_builtins( _: CrateNum ) -> bool {
1875- cycle_fatal
18761864 desc { "getting whether a crate has `#![no_builtins]`" }
18771865 separate_provide_extern
18781866 }
18791867 query symbol_mangling_version( _: CrateNum ) -> SymbolManglingVersion {
1880- cycle_fatal
18811868 desc { "getting a crate's symbol mangling version" }
18821869 separate_provide_extern
18831870 }
0 commit comments