about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2016-08-09 15:28:24 -0400
committerMichael Woerister <michaelwoerister@posteo.net>2016-08-11 09:56:00 -0400
commita7de0bc4c6059d8455338d20444b38da85792500 (patch)
tree08c1c55ff18ffe4f303e63722826df87cd81da5c
parent65eb024542835c0235c31ef0e2381d155c797b03 (diff)
downloadrust-a7de0bc4c6059d8455338d20444b38da85792500.tar.gz
rust-a7de0bc4c6059d8455338d20444b38da85792500.zip
Address comments by reviewers.
-rw-r--r--src/librustc/session/config.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index a1e30cbaae9..e988ddcd97b 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -258,13 +258,11 @@ top_level_options!(
         lint_cap: Option<lint::Level> [TRACKED],
         describe_lints: bool [UNTRACKED],
         output_types: OutputTypes [TRACKED],
-        // FIXME(mw): I'm not entirely sure if this can have any influence on
-        //            incremental compilation apart from what is already handled
-        //            by crate metadata hashes. Better track it.
+        // FIXME(mw): We track this for now but it actually doesn't make too
+        //            much sense: The search path can stay the same while the
+        //            things discovered there might have changed on disk.
         search_paths: SearchPaths [TRACKED],
-        // FIXME(mw): Might not need to do dep-tracking for `libs`?
         libs: Vec<(String, cstore::NativeLibraryKind)> [TRACKED],
-        // FIXME(mw): Might not need to do dep-tracking for `maybe_sysroot`?
         maybe_sysroot: Option<PathBuf> [TRACKED],
 
         target_triple: String [TRACKED],
@@ -280,8 +278,9 @@ top_level_options!(
         debugging_opts: DebuggingOptions [TRACKED],
         prints: Vec<PrintRequest> [UNTRACKED],
         cg: CodegenOptions [TRACKED],
-        // FIXME(mw): `externs` might not need to be tracked but let's err on
-        //            the side of caution for now.
+        // FIXME(mw): We track this for now but it actually doesn't make too
+        //            much sense: The value of this option can stay the same
+        //            while the files they refer to might have changed on disk.
         externs: Externs [TRACKED],
         crate_name: Option<String> [TRACKED],
         // An optional name to use as the crate for std during std injection,
@@ -1719,11 +1718,12 @@ mod dep_tracking {
         ($t:ty) => (
             impl DepTrackingHash for Vec<$t> {
                 fn hash(&self, hasher: &mut SipHasher, error_format: ErrorOutputType) {
-                    let mut elems = self.clone();
+                    let mut elems: Vec<&$t> = self.iter().collect();
                     elems.sort();
-                    for (i, e) in elems.iter().enumerate() {
-                        Hash::hash(&i, hasher);
-                        DepTrackingHash::hash(e, hasher, error_format);
+                    Hash::hash(&elems.len(), hasher);
+                    for (index, elem) in elems.iter().enumerate() {
+                        Hash::hash(&index, hasher);
+                        DepTrackingHash::hash(*elem, hasher, error_format);
                     }
                 }
             }