Skip to content

Commit 9d87842

Browse files
committed
wip
1 parent 18dfd62 commit 9d87842

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

src/rustup.rs

+10
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ pub(crate) fn version_range(
6666
cargo::minor_version(cmd!("cargo", "+stable"))?
6767
}
6868
Some(end) => {
69+
let end = match end.strip_prefix('=') {
70+
Some(end) => end,
71+
None => {
72+
warn!(
73+
"using `..` for inclusive range is deprecated; consider using {}",
74+
range.replace("..", "..=")
75+
);
76+
end
77+
}
78+
};
6979
let end = end.parse()?;
7080
check(&end)?;
7181
end.minor

tests/test.rs

+13-5
Original file line numberDiff line numberDiff line change
@@ -1318,14 +1318,22 @@ fn default_feature_behavior() {
13181318
#[cfg_attr(windows, ignore)] // rustup bug: https://github.com/rust-lang/rustup/issues/3036
13191319
#[test]
13201320
fn version_range() {
1321-
cargo_hack(["check", "--version-range", "1.63..1.64"]).assert_success("real").stderr_contains(
1321+
cargo_hack(["check", "--version-range", "1.63..=1.64"]).assert_success("real").stderr_contains(
13221322
"
13231323
running `cargo +1.63 check` on real (1/2)
13241324
running `cargo +1.64 check` on real (2/2)
13251325
",
13261326
);
13271327

1328-
cargo_hack(["check", "--version-range", "1.63..1.64", "--target", TARGET])
1328+
cargo_hack(["check", "--version-range", "1.63..1.64"]).assert_failure("real").stderr_contains(
1329+
"
1330+
warning: using `..` for inclusive range is deprecated; consider using 1.63..=1.64
1331+
running `cargo +1.63 check` on real (1/2)
1332+
running `cargo +1.64 check` on real (2/2)
1333+
",
1334+
);
1335+
1336+
cargo_hack(["check", "--version-range", "1.63..=1.64", "--target", TARGET])
13291337
.assert_success("real")
13301338
.stderr_contains(format!(
13311339
"
@@ -1349,7 +1357,7 @@ fn multi_target() {
13491357
cargo_hack([
13501358
"check",
13511359
"--version-range",
1352-
"1.63..1.64",
1360+
"1.63..=1.64",
13531361
"--target",
13541362
&format!("aarch64{target_suffix}"),
13551363
])
@@ -1364,7 +1372,7 @@ fn multi_target() {
13641372
cargo_hack([
13651373
"check",
13661374
"--version-range",
1367-
"1.63..1.64",
1375+
"1.63..=1.64",
13681376
"--target",
13691377
&format!("x86_64{target_suffix}"),
13701378
"--target",
@@ -1382,7 +1390,7 @@ fn multi_target() {
13821390
cargo_hack([
13831391
"check",
13841392
"--version-range",
1385-
"1.63..1.64",
1393+
"1.63..=1.64",
13861394
"--target",
13871395
&format!("x86_64{target_suffix}"),
13881396
"--target",

0 commit comments

Comments
 (0)