Skip to content

Commit 699b30a

Browse files
committed
test(install): Verify existing top-level MSRV behavior
1 parent c97c906 commit 699b30a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/testsuite/install.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,3 +2463,30 @@ For more information, try '--help'.
24632463
.with_status(1)
24642464
.run();
24652465
}
2466+
2467+
#[cargo_test]
2468+
fn install_incompat_msrv() {
2469+
Package::new("foo", "0.1.0")
2470+
.file("src/main.rs", "fn main() {}")
2471+
.rust_version("1.30")
2472+
.publish();
2473+
Package::new("foo", "0.2.0")
2474+
.file("src/main.rs", "fn main() {}")
2475+
.rust_version("1.9876.0")
2476+
.publish();
2477+
2478+
cargo_process("install foo")
2479+
.with_stderr("\
2480+
[UPDATING] `dummy-registry` index
2481+
[DOWNLOADING] crates ...
2482+
[DOWNLOADED] foo v0.2.0 (registry `[..]`)
2483+
[INSTALLING] foo v0.2.0
2484+
[ERROR] failed to compile `foo v0.2.0`, intermediate artifacts can be found at `[..]`.
2485+
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
2486+
2487+
Caused by:
2488+
package `foo v0.2.0` cannot be built because it requires rustc 1.9876.0 or newer, while the currently active rustc version is [..]
2489+
Try re-running cargo install with `--locked`
2490+
")
2491+
.with_status(101).run();
2492+
}

0 commit comments

Comments
 (0)