@@ -1122,46 +1122,25 @@ impl TomlManifest {
11221122 }
11231123
11241124 let rust_version = if let Some ( rust_version) = & project. rust_version {
1125- if features. require ( Feature :: rust_version ( ) ) . is_err ( ) {
1126- let mut msg =
1127- "`rust-version` is not supported on this version of Cargo and will be ignored"
1128- . to_string ( ) ;
1129- if config. nightly_features_allowed {
1130- msg. push_str (
1131- "\n \n \
1132- consider adding `cargo-features = [\" rust-version\" ]` to the manifest",
1133- ) ;
1134- } else {
1135- msg. push_str (
1136- "\n \n \
1137- this Cargo does not support nightly features, but if you\n \
1138- switch to nightly channel you can add\n \
1139- `cargo-features = [\" rust-version\" ]` to enable this feature",
1140- ) ;
1141- }
1142- warnings. push ( msg) ;
1143- None
1144- } else {
1145- let req = match semver:: VersionReq :: parse ( rust_version) {
1146- // Exclude semver operators like `^` and pre-release identifiers
1147- Ok ( req) if rust_version. chars ( ) . all ( |c| c. is_ascii_digit ( ) || c == '.' ) => req,
1148- _ => bail ! ( "`rust-version` must be a value like \" 1.32\" " ) ,
1149- } ;
1150- if let Some ( first_version) = edition. first_version ( ) {
1151- let unsupported =
1152- semver:: Version :: new ( first_version. major , first_version. minor - 1 , 9999 ) ;
1153- if req. matches ( & unsupported) {
1154- bail ! (
1155- "rust-version {} is older than first version ({}) required by \
1156- the specified edition ({})",
1157- rust_version,
1158- first_version,
1159- edition,
1160- )
1161- }
1125+ let req = match semver:: VersionReq :: parse ( rust_version) {
1126+ // Exclude semver operators like `^` and pre-release identifiers
1127+ Ok ( req) if rust_version. chars ( ) . all ( |c| c. is_ascii_digit ( ) || c == '.' ) => req,
1128+ _ => bail ! ( "`rust-version` must be a value like \" 1.32\" " ) ,
1129+ } ;
1130+ if let Some ( first_version) = edition. first_version ( ) {
1131+ let unsupported =
1132+ semver:: Version :: new ( first_version. major , first_version. minor - 1 , 9999 ) ;
1133+ if req. matches ( & unsupported) {
1134+ bail ! (
1135+ "rust-version {} is older than first version ({}) required by \
1136+ the specified edition ({})",
1137+ rust_version,
1138+ first_version,
1139+ edition,
1140+ )
11621141 }
1163- Some ( rust_version. clone ( ) )
11641142 }
1143+ Some ( rust_version. clone ( ) )
11651144 } else {
11661145 None
11671146 } ;
0 commit comments