Skip to content

Commit a3d2871

Browse files
kaniinicuviper
authored andcommitted
bootstrap: config: fix version comparison bug
Rust requires a previous version of Rust to build, such as the current version, or the previous version. However, the version comparison logic did not take patch releases into consideration when doing the version comparison for the current branch, e.g. Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version match, or the previous version. Adjust the version comparison logic to tolerate mismatches in the patch version. Signed-off-by: Ariadne Conill <[email protected]> (cherry picked from commit 31a81a0)
1 parent 0426c1f commit a3d2871

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bootstrap/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,8 @@ impl Config {
19251925
.unwrap();
19261926
if !(source_version == rustc_version
19271927
|| (source_version.major == rustc_version.major
1928-
&& source_version.minor == rustc_version.minor + 1))
1928+
&& (source_version.minor == rustc_version.minor
1929+
|| source_version.minor == rustc_version.minor + 1)))
19291930
{
19301931
let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1);
19311932
eprintln!(

0 commit comments

Comments
 (0)