about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/dep_graph/graph.rs14
-rw-r--r--src/librustc_data_structures/lib.rs1
-rw-r--r--src/librustc_data_structures/sync.rs4
-rw-r--r--src/librustc_session/session.rs6
4 files changed, 14 insertions, 11 deletions
diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs
index d952bf7ab9e..aa7f4f2155d 100644
--- a/src/librustc/dep_graph/graph.rs
+++ b/src/librustc/dep_graph/graph.rs
@@ -3,7 +3,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_index::vec::{Idx, IndexVec};
 use smallvec::SmallVec;
-use rustc_data_structures::sync::{Lrc, Lock, AtomicU32, AtomicU64, Ordering};
+use rustc_data_structures::sync::{Lrc, Lock, AtomicU32, AtomicUsize, Ordering};
 use rustc_data_structures::sharded::{self, Sharded};
 use std::sync::atomic::Ordering::SeqCst;
 use std::env;
@@ -485,8 +485,8 @@ impl DepGraph {
         if cfg!(debug_assertions) {
             let current_dep_graph = &self.data.as_ref().unwrap().current;
 
-            Some((current_dep_graph.total_read_count.load(SeqCst),
-                  current_dep_graph.total_duplicate_read_count.load(SeqCst)))
+            Some((current_dep_graph.total_read_count.load(SeqCst) as u64,
+                  current_dep_graph.total_duplicate_read_count.load(SeqCst) as u64))
         } else {
             None
         }
@@ -970,8 +970,8 @@ pub(super) struct CurrentDepGraph {
 
     /// These are simple counters that are for profiling and
     /// debugging and only active with `debug_assertions`.
-    total_read_count: AtomicU64,
-    total_duplicate_read_count: AtomicU64,
+    total_read_count: AtomicUsize,
+    total_duplicate_read_count: AtomicUsize,
 }
 
 impl CurrentDepGraph {
@@ -1012,8 +1012,8 @@ impl CurrentDepGraph {
             )),
             anon_id_seed: stable_hasher.finish(),
             forbidden_edge,
-            total_read_count: AtomicU64::new(0),
-            total_duplicate_read_count: AtomicU64::new(0),
+            total_read_count: AtomicUsize::new(0),
+            total_duplicate_read_count: AtomicUsize::new(0),
         }
     }
 
diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs
index fb541637e5f..02611a36aae 100644
--- a/src/librustc_data_structures/lib.rs
+++ b/src/librustc_data_structures/lib.rs
@@ -24,6 +24,7 @@
 #![feature(integer_atomics)]
 #![feature(test)]
 #![feature(associated_type_bounds)]
+#![feature(cfg_target_has_atomic)]
 
 #![cfg_attr(unix, feature(libc))]
 
diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs
index 6a19f52897e..c4aed0628ba 100644
--- a/src/librustc_data_structures/sync.rs
+++ b/src/librustc_data_structures/sync.rs
@@ -317,7 +317,9 @@ cfg_if! {
         pub use parking_lot::MutexGuard as LockGuard;
         pub use parking_lot::MappedMutexGuard as MappedLockGuard;
 
-        pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64};
+        pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32};
+        #[cfg(target_has_atomic = "64")]
+        pub use std::sync::atomic::{AtomicU64};
 
         pub use crossbeam_utils::atomic::AtomicCell;
 
diff --git a/src/librustc_session/session.rs b/src/librustc_session/session.rs
index 150d207e5bf..4e72249aed1 100644
--- a/src/librustc_session/session.rs
+++ b/src/librustc_session/session.rs
@@ -14,7 +14,7 @@ use rustc_errors::ErrorReported;
 
 use rustc_data_structures::base_n;
 use rustc_data_structures::sync::{
-    self, Lrc, Lock, OneThread, Once, AtomicU64, AtomicUsize, Ordering,
+    self, Lrc, Lock, OneThread, Once, AtomicUsize, Ordering,
     Ordering::SeqCst,
 };
 use rustc_data_structures::impl_stable_hash_via_hash;
@@ -119,7 +119,7 @@ pub struct Session {
     /// If `-zprint-fuel=crate`, `Some(crate)`.
     pub print_fuel_crate: Option<String>,
     /// Always set to zero and incremented so that we can print fuel expended by a crate.
-    pub print_fuel: AtomicU64,
+    pub print_fuel: AtomicUsize,
 
     /// Loaded up early on in the initialization of this `Session` to avoid
     /// false positives about a job server in our environment.
@@ -1116,7 +1116,7 @@ fn build_session_(
         out_of_fuel: false,
     });
     let print_fuel_crate = sopts.debugging_opts.print_fuel.clone();
-    let print_fuel = AtomicU64::new(0);
+    let print_fuel = AtomicUsize::new(0);
 
     let working_dir = env::current_dir().unwrap_or_else(|e|
         parse_sess.span_diagnostic