X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fquery%2Fmod.rs;h=a20e011b91a7543697bdb006784a82e205397ace;hb=c411c22eb00580f4bea32eabc7f4458d4ee4a598;hp=4a2ec9b9687f39590be5ca7f104a3dc85b7efe0b;hpb=f48e576756cd0c360e5522974fc8d5867b439092;p=rust.git diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index 4a2ec9b9687..a20e011b91a 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -1,6 +1,6 @@ use crate::dep_graph::{DepKind, DepNode, RecoverKey, SerializedDepNodeIndex}; use crate::mir; -use crate::mir::interpret::GlobalId; +use crate::mir::interpret::{GlobalId, LitToConstInput}; use crate::traits; use crate::traits::query::{ CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal, @@ -82,7 +82,7 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String { desc { "looking up the native libraries of a linked crate" } } - query lint_levels(_: CrateNum) -> &'tcx lint::LintLevelMap { + query lint_levels(_: CrateNum) -> &'tcx LintLevelMap { eval_always desc { "computing the lint levels for items in this crate" } } @@ -505,10 +505,26 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String { desc { "extract field of const" } } + /// Destructure a constant ADT or array into its variant indent and its + /// field values. + query destructure_const( + key: ty::ParamEnvAnd<'tcx, &'tcx ty::Const<'tcx>> + ) -> mir::DestructuredConst<'tcx> { + no_force + desc { "destructure constant" } + } + query const_caller_location(key: (rustc_span::Symbol, u32, u32)) -> &'tcx ty::Const<'tcx> { no_force desc { "get a &core::panic::Location referring to a span" } } + + query lit_to_const( + key: LitToConstInput<'tcx> + ) -> Result<&'tcx ty::Const<'tcx>, LitToConstError> { + no_force + desc { "converting literal to const" } + } } TypeChecking { @@ -686,10 +702,6 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String { fatal_cycle desc { "checking if the crate has_panic_handler" } } - query is_sanitizer_runtime(_: CrateNum) -> bool { - fatal_cycle - desc { "query a crate is `#![sanitizer_runtime]`" } - } query is_profiler_runtime(_: CrateNum) -> bool { fatal_cycle desc { "query a crate is `#![profiler_runtime]`" } @@ -1136,11 +1148,11 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String { desc { "normalizing `{:?}`", goal } } - query substitute_normalize_and_test_predicates(key: (DefId, SubstsRef<'tcx>)) -> bool { + query substitute_normalize_and_test_predicates(key: (DefId, SubstsRef<'tcx>, traits::TraitQueryMode)) -> bool { no_force desc { |tcx| - "testing substituted normalized predicates:`{}`", - tcx.def_path_str(key.0) + "testing substituted normalized predicates in mode {:?}:`{}`", + key.2, tcx.def_path_str(key.0) } }