@@ -958,6 +958,86 @@ fn cargo_install_ignores_msrv_config() {
958
958
. run ( ) ;
959
959
}
960
960
961
+ #[ cargo_test( nightly, reason = "edition2024 in rustc is unstable" ) ]
962
+ fn cargo_install_ignores_resolver_v3_msrv_change ( ) {
963
+ Package :: new ( "dep" , "1.0.0" )
964
+ . rust_version ( "1.50" )
965
+ . file ( "src/lib.rs" , "fn hello() {}" )
966
+ . publish ( ) ;
967
+ Package :: new ( "dep" , "1.1.0" )
968
+ . rust_version ( "1.70" )
969
+ . file ( "src/lib.rs" , "fn hello() {}" )
970
+ . publish ( ) ;
971
+ Package :: new ( "foo" , "0.0.1" )
972
+ . rust_version ( "1.60" )
973
+ . cargo_feature ( "edition2024" )
974
+ . resolver ( "3" )
975
+ . file ( "src/main.rs" , "fn main() {}" )
976
+ . dep ( "dep" , "1" )
977
+ . publish ( ) ;
978
+
979
+ cargo_process ( "install foo" )
980
+ . arg ( "-Zmsrv-policy" )
981
+ . masquerade_as_nightly_cargo ( & [ "edition2024" , "msrv-policy" ] )
982
+ . with_stderr_data ( str![ [ r#"
983
+ [UPDATING] `dummy-registry` index
984
+ [DOWNLOADING] crates ...
985
+ [DOWNLOADED] foo v0.0.1 (registry `dummy-registry`)
986
+ [INSTALLING] foo v0.0.1
987
+ [LOCKING] 1 package to latest compatible version
988
+ [DOWNLOADING] crates ...
989
+ [DOWNLOADED] dep v1.1.0 (registry `dummy-registry`)
990
+ [COMPILING] dep v1.1.0
991
+ [COMPILING] foo v0.0.1
992
+ [FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
993
+ [INSTALLING] [ROOT]/home/.cargo/bin/foo[EXE]
994
+ [INSTALLED] package `foo v0.0.1` (executable `foo[EXE]`)
995
+ [WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries
996
+
997
+ "# ] ] )
998
+ . run ( ) ;
999
+ }
1000
+
1001
+ #[ cargo_test( nightly, reason = "edition2024 in rustc is unstable" ) ]
1002
+ fn cargo_install_ignores_edition_2024_msrv_change ( ) {
1003
+ Package :: new ( "dep" , "1.0.0" )
1004
+ . rust_version ( "1.50" )
1005
+ . file ( "src/lib.rs" , "fn hello() {}" )
1006
+ . publish ( ) ;
1007
+ Package :: new ( "dep" , "1.1.0" )
1008
+ . rust_version ( "1.70" )
1009
+ . file ( "src/lib.rs" , "fn hello() {}" )
1010
+ . publish ( ) ;
1011
+ Package :: new ( "foo" , "0.0.1" )
1012
+ . rust_version ( "1.60" )
1013
+ . cargo_feature ( "edition2024" )
1014
+ . edition ( "2024" )
1015
+ . file ( "src/main.rs" , "fn main() {}" )
1016
+ . dep ( "dep" , "1" )
1017
+ . publish ( ) ;
1018
+
1019
+ cargo_process ( "install foo" )
1020
+ . arg ( "-Zmsrv-policy" )
1021
+ . masquerade_as_nightly_cargo ( & [ "edition2024" , "msrv-policy" ] )
1022
+ . with_stderr_data ( str![ [ r#"
1023
+ [UPDATING] `dummy-registry` index
1024
+ [DOWNLOADING] crates ...
1025
+ [DOWNLOADED] foo v0.0.1 (registry `dummy-registry`)
1026
+ [INSTALLING] foo v0.0.1
1027
+ [LOCKING] 1 package to latest compatible version
1028
+ [DOWNLOADING] crates ...
1029
+ [DOWNLOADED] dep v1.1.0 (registry `dummy-registry`)
1030
+ [COMPILING] dep v1.1.0
1031
+ [COMPILING] foo v0.0.1
1032
+ [FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
1033
+ [INSTALLING] [ROOT]/home/.cargo/bin/foo[EXE]
1034
+ [INSTALLED] package `foo v0.0.1` (executable `foo[EXE]`)
1035
+ [WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries
1036
+
1037
+ "# ] ] )
1038
+ . run ( ) ;
1039
+ }
1040
+
961
1041
#[ cargo_test]
962
1042
fn report_rust_versions ( ) {
963
1043
Package :: new ( "dep-only-low-compatible" , "1.55.0" )
0 commit comments