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::values::Value`, which produces an appropriate placeholder
154- // (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 an fatal error on query cycles instead.
151+ // The result type of each query must implement `Clone`. Additionally
152+ // `ty::query::values::Value` can be implemented which produces an appropriate
153+ // placeholder (error) value if the query resulted in a query cycle.
154+ // Queries without a `Value` 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 }
@@ -1318,7 +1316,6 @@ rustc_queries! {
13181316 /// Return the set of (transitive) callees that may result in a recursive call to `key`,
13191317 /// if we were able to walk all callees.
13201318 query mir_callgraph_cyclic( key: LocalDefId ) -> & ' tcx Option <UnordSet <LocalDefId >> {
1321- cycle_fatal
13221319 arena_cache
13231320 desc {
13241321 "computing (transitive) callees of `{}` that may recurse" ,
@@ -1329,7 +1326,6 @@ rustc_queries! {
13291326
13301327 /// Obtain all the calls into other local functions
13311328 query mir_inliner_callees( key: ty:: InstanceKind <' tcx>) -> & ' tcx [ ( DefId , GenericArgsRef <' tcx>) ] {
1332- cycle_fatal
13331329 desc {
13341330 "computing all local function calls in `{}`" ,
13351331 tcx. def_path_str( key. def_id( ) ) ,
@@ -1824,31 +1820,26 @@ rustc_queries! {
18241820 }
18251821
18261822 query is_compiler_builtins( _: CrateNum ) -> bool {
1827- cycle_fatal
18281823 desc { "checking if the crate is_compiler_builtins" }
18291824 separate_provide_extern
18301825 }
18311826 query has_global_allocator( _: CrateNum ) -> bool {
18321827 // This query depends on untracked global state in CStore
18331828 eval_always
1834- cycle_fatal
18351829 desc { "checking if the crate has_global_allocator" }
18361830 separate_provide_extern
18371831 }
18381832 query has_alloc_error_handler( _: CrateNum ) -> bool {
18391833 // This query depends on untracked global state in CStore
18401834 eval_always
1841- cycle_fatal
18421835 desc { "checking if the crate has_alloc_error_handler" }
18431836 separate_provide_extern
18441837 }
18451838 query has_panic_handler( _: CrateNum ) -> bool {
1846- cycle_fatal
18471839 desc { "checking if the crate has_panic_handler" }
18481840 separate_provide_extern
18491841 }
18501842 query is_profiler_runtime( _: CrateNum ) -> bool {
1851- cycle_fatal
18521843 desc { "checking if a crate is `#![profiler_runtime]`" }
18531844 separate_provide_extern
18541845 }
@@ -1857,22 +1848,18 @@ rustc_queries! {
18571848 cache_on_disk_if { true }
18581849 }
18591850 query required_panic_strategy( _: CrateNum ) -> Option <PanicStrategy > {
1860- cycle_fatal
18611851 desc { "getting a crate's required panic strategy" }
18621852 separate_provide_extern
18631853 }
18641854 query panic_in_drop_strategy( _: CrateNum ) -> PanicStrategy {
1865- cycle_fatal
18661855 desc { "getting a crate's configured panic-in-drop strategy" }
18671856 separate_provide_extern
18681857 }
18691858 query is_no_builtins( _: CrateNum ) -> bool {
1870- cycle_fatal
18711859 desc { "getting whether a crate has `#![no_builtins]`" }
18721860 separate_provide_extern
18731861 }
18741862 query symbol_mangling_version( _: CrateNum ) -> SymbolManglingVersion {
1875- cycle_fatal
18761863 desc { "getting a crate's symbol mangling version" }
18771864 separate_provide_extern
18781865 }
0 commit comments