Skip to content

Commit 31a81a0

Browse files
committed
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]>
1 parent defed62 commit 31a81a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bootstrap/config.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,8 @@ impl Config {
20042004
.unwrap();
20052005
if !(source_version == rustc_version
20062006
|| (source_version.major == rustc_version.major
2007-
&& source_version.minor == rustc_version.minor + 1))
2007+
&& (source_version.minor == rustc_version.minor
2008+
|| source_version.minor == rustc_version.minor + 1)))
20082009
{
20092010
let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1);
20102011
eprintln!(

0 commit comments

Comments
 (0)