From b10e9abc4250b68032af2d675f69319d47948cb6 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 24 Jul 2022 00:01:41 -0700 Subject: [PATCH] Suggest cargo install --locked on MSRV errors when installing --- src/cargo/ops/cargo_compile.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cargo/ops/cargo_compile.rs b/src/cargo/ops/cargo_compile.rs index 2ba1a62e8e18..4d1eed96da38 100644 --- a/src/cargo/ops/cargo_compile.rs +++ b/src/cargo/ops/cargo_compile.rs @@ -662,7 +662,11 @@ pub fn create_bcx<'a, 'cfg>( } let guidance = if ws.is_ephemeral() { - String::new() + if ws.ignore_lock() { + "Try re-running cargo install with `--locked`".to_string() + } else { + String::new() + } } else { format!( "Either upgrade to rustc {} or newer, or use\n\