@@ -258,13 +258,11 @@ top_level_options!(
258
258
lint_cap: Option <lint:: Level > [ TRACKED ] ,
259
259
describe_lints: bool [ UNTRACKED ] ,
260
260
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 .
264
264
search_paths: SearchPaths [ TRACKED ] ,
265
- // FIXME(mw): Might not need to do dep-tracking for `libs`?
266
265
libs: Vec <( String , cstore:: NativeLibraryKind ) > [ TRACKED ] ,
267
- // FIXME(mw): Might not need to do dep-tracking for `maybe_sysroot`?
268
266
maybe_sysroot: Option <PathBuf > [ TRACKED ] ,
269
267
270
268
target_triple: String [ TRACKED ] ,
@@ -280,8 +278,9 @@ top_level_options!(
280
278
debugging_opts: DebuggingOptions [ TRACKED ] ,
281
279
prints: Vec <PrintRequest > [ UNTRACKED ] ,
282
280
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.
285
284
externs: Externs [ TRACKED ] ,
286
285
crate_name: Option <String > [ TRACKED ] ,
287
286
// An optional name to use as the crate for std during std injection,
@@ -1719,11 +1718,12 @@ mod dep_tracking {
1719
1718
( $t: ty) => (
1720
1719
impl DepTrackingHash for Vec <$t> {
1721
1720
fn hash( & self , hasher: & mut SipHasher , error_format: ErrorOutputType ) {
1722
- let mut elems = self . clone ( ) ;
1721
+ let mut elems: Vec < & $t> = self . iter ( ) . collect ( ) ;
1723
1722
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) ;
1727
1727
}
1728
1728
}
1729
1729
}
0 commit comments