about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc/ty/query/job.rs7
-rw-r--r--src/librustc/ty/query/on_disk_cache.rs6
2 files changed, 3 insertions, 10 deletions
diff --git a/src/librustc/ty/query/job.rs b/src/librustc/ty/query/job.rs
index 559093b8f18..4ee5ef6b1fd 100644
--- a/src/librustc/ty/query/job.rs
+++ b/src/librustc/ty/query/job.rs
@@ -406,7 +406,7 @@ fn remove_cycle<'tcx>(
 
         // Find the queries in the cycle which are
         // connected to queries outside the cycle
-        let entry_points: Vec<_> = stack.iter().filter_map(|(span, query)| {
+        let entry_points = stack.iter().filter_map(|(span, query)| {
             if query.parent.is_none() {
                 // This query is connected to the root (it has no query parent)
                 Some((*span, query.clone(), None))
@@ -431,10 +431,7 @@ fn remove_cycle<'tcx>(
                     Some((*span, query.clone(), Some(waiter)))
                 }
             }
-        }).collect();
-
-        let entry_points: Vec<(Span, Lrc<QueryJob<'tcx>>, Option<(Span, Lrc<QueryJob<'tcx>>)>)>
-         = entry_points;
+        }).collect::<Vec<(Span, Lrc<QueryJob<'tcx>>, Option<(Span, Lrc<QueryJob<'tcx>>)>)>>();
 
         // Deterministically pick an entry point
         let (_, entry_point, usage) = pick_query(tcx, &entry_points, |e| (e.0, e.1.clone()));
diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs
index 04c880826fe..94456e3e773 100644
--- a/src/librustc/ty/query/on_disk_cache.rs
+++ b/src/librustc/ty/query/on_disk_cache.rs
@@ -398,11 +398,7 @@ impl<'sess> OnDiskCache<'sess> {
                              -> Option<T>
         where T: Decodable
     {
-        let pos = if let Some(&pos) = index.get(&dep_node_index) {
-            pos
-        } else {
-            return None
-        };
+        let pos = index.get(&dep_node_index).cloned()?;
 
         // Initialize the cnum_map using the value from the thread which finishes the closure first
         self.cnum_map.init_nonlocking_same(|| {