Skip to content

Commit a7de0bc

Browse files
Address comments by reviewers.
1 parent 65eb024 commit a7de0bc

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/librustc/session/config.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,11 @@ top_level_options!(
258258
lint_cap: Option<lint::Level> [TRACKED],
259259
describe_lints: bool [UNTRACKED],
260260
output_types: OutputTypes [TRACKED],
261-
// FIXME(mw): I'm not entirely sure if this can have any influence on
262-
// incremental compilation apart from what is already handled
263-
// by crate metadata hashes. Better track it.
261+
// FIXME(mw): We track this for now but it actually doesn't make too
262+
// much sense: The search path can stay the same while the
263+
// things discovered there might have changed on disk.
264264
search_paths: SearchPaths [TRACKED],
265-
// FIXME(mw): Might not need to do dep-tracking for `libs`?
266265
libs: Vec<(String, cstore::NativeLibraryKind)> [TRACKED],
267-
// FIXME(mw): Might not need to do dep-tracking for `maybe_sysroot`?
268266
maybe_sysroot: Option<PathBuf> [TRACKED],
269267

270268
target_triple: String [TRACKED],
@@ -280,8 +278,9 @@ top_level_options!(
280278
debugging_opts: DebuggingOptions [TRACKED],
281279
prints: Vec<PrintRequest> [UNTRACKED],
282280
cg: CodegenOptions [TRACKED],
283-
// FIXME(mw): `externs` might not need to be tracked but let's err on
284-
// the side of caution for now.
281+
// FIXME(mw): We track this for now but it actually doesn't make too
282+
// much sense: The value of this option can stay the same
283+
// while the files they refer to might have changed on disk.
285284
externs: Externs [TRACKED],
286285
crate_name: Option<String> [TRACKED],
287286
// An optional name to use as the crate for std during std injection,
@@ -1719,11 +1718,12 @@ mod dep_tracking {
17191718
($t:ty) => (
17201719
impl DepTrackingHash for Vec<$t> {
17211720
fn hash(&self, hasher: &mut SipHasher, error_format: ErrorOutputType) {
1722-
let mut elems = self.clone();
1721+
let mut elems: Vec<&$t> = self.iter().collect();
17231722
elems.sort();
1724-
for (i, e) in elems.iter().enumerate() {
1725-
Hash::hash(&i, hasher);
1726-
DepTrackingHash::hash(e, hasher, error_format);
1723+
Hash::hash(&elems.len(), hasher);
1724+
for (index, elem) in elems.iter().enumerate() {
1725+
Hash::hash(&index, hasher);
1726+
DepTrackingHash::hash(*elem, hasher, error_format);
17271727
}
17281728
}
17291729
}

0 commit comments

Comments
 (0)