@@ -164,23 +164,20 @@ fn rustup_cargo() -> Execs {
164
164
165
165
#[ cargo_test]
166
166
fn auto_gc_gated ( ) {
167
- // Requires -Zgc to both track last-use data and to run auto-gc.
167
+ // Requires -Zgc to run auto-gc.
168
168
let p = basic_foo_bar_project ( ) ;
169
169
p. cargo ( "check" )
170
170
. env ( "__CARGO_TEST_LAST_USE_NOW" , months_ago_unix ( 4 ) )
171
171
. run ( ) ;
172
- // Check that it did not create a database or delete anything .
172
+ // Check that it created a database.
173
173
let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
174
- assert ! ( ! GlobalCacheTracker :: db_path( & gctx)
174
+ assert ! ( GlobalCacheTracker :: db_path( & gctx)
175
175
. into_path_unlocked( )
176
176
. exists( ) ) ;
177
177
assert_eq ! ( get_index_names( ) . len( ) , 1 ) ;
178
178
179
179
// Again in the future, shouldn't auto-gc.
180
180
p. cargo ( "check" ) . run ( ) ;
181
- assert ! ( !GlobalCacheTracker :: db_path( & gctx)
182
- . into_path_unlocked( )
183
- . exists( ) ) ;
184
181
assert_eq ! ( get_index_names( ) . len( ) , 1 ) ;
185
182
}
186
183
@@ -203,7 +200,7 @@ See [..]
203
200
fn implies_source ( ) {
204
201
// Checks that when a src, crate, or checkout is marked as used, the
205
202
// corresponding index or git db also gets marked as used.
206
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
203
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
207
204
let _lock = gctx
208
205
. acquire_package_cache_lock ( CacheLockMode :: MutateExclusive )
209
206
. unwrap ( ) ;
@@ -563,7 +560,7 @@ fn auto_gc_various_commands() {
563
560
. masquerade_as_nightly_cargo ( & [ "gc" ] )
564
561
. env ( "__CARGO_TEST_LAST_USE_NOW" , months_ago_unix ( 4 ) )
565
562
. run ( ) ;
566
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
563
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
567
564
let lock = gctx
568
565
. acquire_package_cache_lock ( CacheLockMode :: MutateExclusive )
569
566
. unwrap ( ) ;
@@ -647,7 +644,7 @@ fn updates_last_use_various_commands() {
647
644
. arg ( "-Zgc" )
648
645
. masquerade_as_nightly_cargo ( & [ "gc" ] )
649
646
. run ( ) ;
650
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
647
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
651
648
let lock = gctx
652
649
. acquire_package_cache_lock ( CacheLockMode :: MutateExclusive )
653
650
. unwrap ( ) ;
@@ -696,7 +693,7 @@ fn both_git_and_http_index_cleans() {
696
693
. masquerade_as_nightly_cargo ( & [ "gc" ] )
697
694
. env ( "__CARGO_TEST_LAST_USE_NOW" , months_ago_unix ( 4 ) )
698
695
. run ( ) ;
699
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
696
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
700
697
let lock = gctx
701
698
. acquire_package_cache_lock ( CacheLockMode :: MutateExclusive )
702
699
. unwrap ( ) ;
@@ -821,7 +818,7 @@ fn tracks_sizes() {
821
818
. run ( ) ;
822
819
823
820
// Check that the crate sizes are the same as on disk.
824
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
821
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
825
822
let _lock = gctx
826
823
. acquire_package_cache_lock ( CacheLockMode :: MutateExclusive )
827
824
. unwrap ( ) ;
@@ -863,7 +860,7 @@ fn tracks_sizes() {
863
860
#[ cargo_test]
864
861
fn max_size ( ) {
865
862
// Checks --max-crate-size and --max-src-size with various cleaning thresholds.
866
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
863
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
867
864
868
865
let test_crates = [
869
866
// name, age, crate_size, src_size
@@ -962,7 +959,7 @@ fn max_size_untracked_crate() {
962
959
// When a .crate file exists from an older version of cargo that did not
963
960
// track sizes, `clean --max-crate-size` should populate the db with the
964
961
// sizes.
965
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
962
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
966
963
let cache = paths:: home ( ) . join ( ".cargo/registry/cache/example.com-a6c4a5adcb232b9a" ) ;
967
964
cache. mkdir_p ( ) ;
968
965
paths:: home ( )
@@ -1003,7 +1000,7 @@ fn max_size_untracked_prepare() -> (GlobalContext, Project) {
1003
1000
let p = basic_foo_bar_project ( ) ;
1004
1001
p. cargo ( "fetch" ) . run ( ) ;
1005
1002
// Pretend it was an older version that did not track last-use.
1006
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
1003
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
1007
1004
GlobalCacheTracker :: db_path ( & gctx)
1008
1005
. into_path_unlocked ( )
1009
1006
. rm_rf ( ) ;
@@ -1084,7 +1081,7 @@ fn max_download_size() {
1084
1081
// This creates some sample crates of specific sizes, and then tries
1085
1082
// deleting at various specific size thresholds that exercise different
1086
1083
// edge conditions.
1087
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
1084
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
1088
1085
1089
1086
let test_crates = [
1090
1087
// name, age, crate_size, src_size
@@ -1339,7 +1336,7 @@ fn clean_syncs_missing_files() {
1339
1336
. run ( ) ;
1340
1337
1341
1338
// Verify things are tracked.
1342
- let gctx = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
1339
+ let gctx = GlobalContextBuilder :: new ( ) . build ( ) ;
1343
1340
let lock = gctx
1344
1341
. acquire_package_cache_lock ( CacheLockMode :: MutateExclusive )
1345
1342
. unwrap ( ) ;
@@ -1992,7 +1989,7 @@ fn forward_compatible() {
1992
1989
. masquerade_as_nightly_cargo ( & [ "gc" ] )
1993
1990
. run ( ) ;
1994
1991
1995
- let config = GlobalContextBuilder :: new ( ) . unstable_flag ( "gc" ) . build ( ) ;
1992
+ let config = GlobalContextBuilder :: new ( ) . build ( ) ;
1996
1993
let lock = config
1997
1994
. acquire_package_cache_lock ( CacheLockMode :: MutateExclusive )
1998
1995
. unwrap ( ) ;
0 commit comments