@@ -86,8 +86,6 @@ fn collect_all_toolchains() -> Vec<(Version, String)> {
86
86
. map ( |line| ( rustc_version ( line) , line. to_string ( ) ) )
87
87
. collect ( ) ;
88
88
89
- // Also include *this* cargo.
90
- toolchains. push ( ( rustc_version ( "this" ) , "this" . to_string ( ) ) ) ;
91
89
toolchains. sort_by ( |a, b| a. 0 . cmp ( & b. 0 ) ) ;
92
90
toolchains
93
91
}
@@ -421,15 +419,27 @@ fn new_features() {
421
419
p. build_dir ( ) . rm_rf ( ) ;
422
420
match run_cargo ( ) {
423
421
Ok ( behavior) => {
424
- if version < & Version :: new ( 1 , 51 , 0 ) && toolchain != "this" {
422
+ if version < & Version :: new ( 1 , 51 , 0 ) {
425
423
check_lock ! ( tc_result, "bar" , which, behavior. bar, "1.0.2" ) ;
426
424
check_lock ! ( tc_result, "baz" , which, behavior. baz, "1.0.1" ) ;
427
425
check_lock ! ( tc_result, "new-baz-dep" , which, behavior. new_baz_dep, None ) ;
428
- } else {
426
+ } else if version >= & Version :: new ( 1 , 51 , 0 ) && version <= & Version :: new ( 1 , 59 , 0 ) {
429
427
check_lock ! ( tc_result, "bar" , which, behavior. bar, "1.0.0" ) ;
430
428
check_lock ! ( tc_result, "baz" , which, behavior. baz, None ) ;
431
429
check_lock ! ( tc_result, "new-baz-dep" , which, behavior. new_baz_dep, None ) ;
432
430
}
431
+ // Starting with 1.60, namespaced-features has been stabilized.
432
+ else {
433
+ check_lock ! ( tc_result, "bar" , which, behavior. bar, "1.0.2" ) ;
434
+ check_lock ! ( tc_result, "baz" , which, behavior. baz, "1.0.1" ) ;
435
+ check_lock ! (
436
+ tc_result,
437
+ "new-baz-dep" ,
438
+ which,
439
+ behavior. new_baz_dep,
440
+ "1.0.0"
441
+ ) ;
442
+ }
433
443
}
434
444
Err ( e) => {
435
445
tc_result. push ( format ! ( "unlocked build failed: {}" , e) ) ;
@@ -458,40 +468,48 @@ fn new_features() {
458
468
check_lock ! ( tc_result, "new-baz-dep" , which, behavior. new_baz_dep, None ) ;
459
469
}
460
470
Err ( e) => {
461
- if version >= & Version :: new ( 1 , 51 , 0 ) || toolchain == "this" {
462
- // 1.0.1 can't be used without -Znamespaced-features
463
- // It gets filtered out of the index.
464
- check_err_contains (
465
- & mut tc_result,
466
- e,
467
- "candidate versions found which didn't match: 1.0.2, 1.0.0" ,
468
- ) ;
469
- } else {
470
- tc_result. push ( format ! ( "bar 1.0.1 locked build failed: {}" , e) ) ;
471
- }
471
+ // When version >= 1.51 and <= 1.59,
472
+ // 1.0.1 can't be used without -Znamespaced-features
473
+ // It gets filtered out of the index.
474
+ check_err_contains (
475
+ & mut tc_result,
476
+ e,
477
+ "candidate versions found which didn't match: 1.0.2, 1.0.0" ,
478
+ ) ;
472
479
}
473
480
}
474
481
475
482
let which = "locked bar 1.0.2" ;
476
483
lock_bar_to ( version, 102 ) ;
477
484
match run_cargo ( ) {
478
485
Ok ( behavior) => {
479
- check_lock ! ( tc_result, "bar" , which, behavior. bar, "1.0.2" ) ;
480
- check_lock ! ( tc_result, "baz" , which, behavior. baz, "1.0.1" ) ;
481
- check_lock ! ( tc_result, "new-baz-dep" , which, behavior. new_baz_dep, None ) ;
482
- }
483
- Err ( e) => {
484
- if version >= & Version :: new ( 1 , 51 , 0 ) || toolchain == "this" {
485
- // baz can't lock to 1.0.1, it requires -Znamespaced-features
486
- check_err_contains (
487
- & mut tc_result,
488
- e,
489
- "candidate versions found which didn't match: 1.0.0" ,
486
+ if version <= & Version :: new ( 1 , 59 , 0 ) {
487
+ check_lock ! ( tc_result, "bar" , which, behavior. bar, "1.0.2" ) ;
488
+ check_lock ! ( tc_result, "baz" , which, behavior. baz, "1.0.1" ) ;
489
+ check_lock ! ( tc_result, "new-baz-dep" , which, behavior. new_baz_dep, None ) ;
490
+ }
491
+ // Starting with 1.60, namespaced-features has been stabilized.
492
+ else {
493
+ check_lock ! ( tc_result, "bar" , which, behavior. bar, "1.0.2" ) ;
494
+ check_lock ! ( tc_result, "baz" , which, behavior. baz, "1.0.1" ) ;
495
+ check_lock ! (
496
+ tc_result,
497
+ "new-baz-dep" ,
498
+ which,
499
+ behavior. new_baz_dep,
500
+ "1.0.0"
490
501
) ;
491
- } else {
492
- tc_result. push ( format ! ( "bar 1.0.2 locked build failed: {}" , e) ) ;
493
502
}
494
503
}
504
+ Err ( e) => {
505
+ // When version >= 1.51 and <= 1.59,
506
+ // baz can't lock to 1.0.1, it requires -Znamespaced-features
507
+ check_err_contains (
508
+ & mut tc_result,
509
+ e,
510
+ "candidate versions found which didn't match: 1.0.0" ,
511
+ ) ;
512
+ }
495
513
}
496
514
497
515
unexpected_results. push ( tc_result) ;
0 commit comments