]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/query/plumbing.rs
Rollup merge of #60772 - timvermeulen:slice_iter_nth_back, r=scottmcm
[rust.git] / src / librustc / ty / query / plumbing.rs
index 0051832c5df80bb7f202739477258e69251b9164..0f158d2982a20dc8d2d87772e6cd560fd3782ba3 100644 (file)
@@ -89,7 +89,7 @@ macro_rules! profq_query_msg {
 
 /// A type representing the responsibility to execute the job in the `job` field.
 /// This will poison the relevant query if dropped.
-pub(super) struct JobOwner<'a, 'tcx: 'a, Q: QueryDescription<'tcx> + 'a> {
+pub(super) struct JobOwner<'a, 'tcx, Q: QueryDescription<'tcx> + 'a> {
     cache: &'a Lock<QueryCache<'tcx, Q>>,
     key: Q::Key,
     job: Lrc<QueryJob<'tcx>>,
@@ -104,11 +104,7 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
     /// This function is inlined because that results in a noticeable speed-up
     /// for some compile-time benchmarks.
     #[inline(always)]
-    pub(super) fn try_get(
-        tcx: TyCtxt<'tcx>,
-        span: Span,
-        key: &Q::Key,
-    ) -> TryGetJob<'a, 'tcx, Q> {
+    pub(super) fn try_get(tcx: TyCtxt<'tcx>, span: Span, key: &Q::Key) -> TryGetJob<'a, 'tcx, Q> {
         let cache = Q::query_cache(tcx);
         loop {
             let mut lock = cache.borrow_mut();
@@ -234,7 +230,7 @@ pub struct CycleError<'tcx> {
 }
 
 /// The result of `try_get_lock`
-pub(super) enum TryGetJob<'a, 'tcx: 'a, D: QueryDescription<'tcx> + 'a> {
+pub(super) enum TryGetJob<'a, 'tcx, D: QueryDescription<'tcx> + 'a> {
     /// The query is not yet started. Contains a guard to the cache eventually used to start it.
     NotYetStarted(JobOwner<'a, 'tcx, D>),
 
@@ -351,11 +347,7 @@ pub fn try_print_query_stack() {
     }
 
     #[inline(never)]
-    pub(super) fn get_query<Q: QueryDescription<'tcx>>(
-        self,
-        span: Span,
-        key: Q::Key)
-    -> Q::Value {
+    pub(super) fn get_query<Q: QueryDescription<'tcx>>(self, span: Span, key: Q::Key) -> Q::Value {
         debug!("ty::query::get_query<{}>(key={:?}, span={:?})",
                Q::NAME.as_str(),
                key,
@@ -444,9 +436,8 @@ fn load_from_disk_and_cache_in_memory<Q: QueryDescription<'tcx>>(
         key: Q::Key,
         prev_dep_node_index: SerializedDepNodeIndex,
         dep_node_index: DepNodeIndex,
-        dep_node: &DepNode
-    ) -> Q::Value
-    {
+        dep_node: &DepNode,
+    ) -> Q::Value {
         // Note this function can be called concurrently from the same query
         // We must ensure that this is handled correctly
 
@@ -537,8 +528,8 @@ fn force_query_with_job<Q: QueryDescription<'tcx>>(
         self,
         key: Q::Key,
         job: JobOwner<'_, 'tcx, Q>,
-        dep_node: DepNode)
-    -> (Q::Value, DepNodeIndex) {
+        dep_node: DepNode,
+    -> (Q::Value, DepNodeIndex) {
         // If the following assertion triggers, it can have two reasons:
         // 1. Something is wrong with DepNode creation, either here or
         //    in DepGraph::try_mark_green()
@@ -623,12 +614,7 @@ pub(super) fn ensure_query<Q: QueryDescription<'tcx>>(self, key: Q::Key) -> () {
     }
 
     #[allow(dead_code)]
-    fn force_query<Q: QueryDescription<'tcx>>(
-        self,
-        key: Q::Key,
-        span: Span,
-        dep_node: DepNode
-    ) {
+    fn force_query<Q: QueryDescription<'tcx>>(self, key: Q::Key, span: Span, dep_node: DepNode) {
         profq_msg!(
             self,
             ProfileQueriesMsg::QueryBegin(span.data(),