Skip to content

Commit 361a8f3

Browse files
committed
Hardcode special cases for versions 1.0-1.8
Because these versions don't have v2 manifests available. Fixes #2621.
1 parent 11c855e commit 361a8f3

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/dist/dist.rs

+27-1
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,24 @@ impl FromStr for ParsedToolchainDesc {
174174
}
175175
}
176176

177+
// These versions don't have v2 manifests, but they don't have point releases either,
178+
// so to make the two-part version numbers work for these versions, specially turn
179+
// them into their corresponding ".0" version.
180+
let channel = match c.get(1).unwrap().as_str() {
181+
"1.0" => "1.0.0",
182+
"1.1" => "1.1.0",
183+
"1.2" => "1.2.0",
184+
"1.3" => "1.3.0",
185+
"1.4" => "1.4.0",
186+
"1.5" => "1.5.0",
187+
"1.6" => "1.6.0",
188+
"1.7" => "1.7.0",
189+
"1.8" => "1.8.0",
190+
other => other,
191+
};
192+
177193
Self {
178-
channel: c.get(1).unwrap().as_str().to_owned(),
194+
channel: channel.to_owned(),
179195
date: c.get(2).map(|s| s.as_str()).and_then(fn_map),
180196
target: c.get(3).map(|s| s.as_str()).and_then(fn_map),
181197
}
@@ -1019,6 +1035,16 @@ mod tests {
10191035
"0.0.0-0000-00-00-any-other-thing",
10201036
("0.0.0", Some("0000-00-00"), Some("any-other-thing")),
10211037
),
1038+
// special hardcoded cases that only have v1 manifests
1039+
("1.0", ("1.0.0", None, None)),
1040+
("1.1", ("1.1.0", None, None)),
1041+
("1.2", ("1.2.0", None, None)),
1042+
("1.3", ("1.3.0", None, None)),
1043+
("1.4", ("1.4.0", None, None)),
1044+
("1.5", ("1.5.0", None, None)),
1045+
("1.6", ("1.6.0", None, None)),
1046+
("1.7", ("1.7.0", None, None)),
1047+
("1.8", ("1.8.0", None, None)),
10221048
];
10231049

10241050
for (input, (channel, date, target)) in success_cases {

0 commit comments

Comments
 (0)