@@ -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,
@@ -1692,11 +1691,12 @@ mod dep_tracking {
1692
1691
( $t: ty) => (
1693
1692
impl DepTrackingHash for Vec <$t> {
1694
1693
fn hash( & self , hasher: & mut SipHasher , error_format: ErrorOutputType ) {
1695
- let mut elems = self . clone ( ) ;
1694
+ let mut elems: Vec < & $t> = self . iter ( ) . collect ( ) ;
1696
1695
elems. sort( ) ;
1697
- for ( i, e) in elems. iter( ) . enumerate( ) {
1698
- Hash :: hash( & i, hasher) ;
1699
- DepTrackingHash :: hash( e, hasher, error_format) ;
1696
+ Hash :: hash( & elems. len( ) , hasher) ;
1697
+ for ( index, elem) in elems. iter( ) . enumerate( ) {
1698
+ Hash :: hash( & index, hasher) ;
1699
+ DepTrackingHash :: hash( * elem, hasher, error_format) ;
1700
1700
}
1701
1701
}
1702
1702
}
0 commit comments