From 2e44a65c6bcf467cc1d0c8be5a1e75bb3c8e7014 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 2 Aug 2022 10:50:46 -0700 Subject: [PATCH] Only show advice to use `cargo update --precise` for non-local packages Packages in the local workspace can't get updated this way; the user just needs to point to a different source, or otherwise update the package themselves. --- src/cargo/ops/cargo_compile.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cargo/ops/cargo_compile.rs b/src/cargo/ops/cargo_compile.rs index 2ac85cad48a2..5f9c9147c8d6 100644 --- a/src/cargo/ops/cargo_compile.rs +++ b/src/cargo/ops/cargo_compile.rs @@ -667,7 +667,7 @@ pub fn create_bcx<'a, 'cfg>( } else { String::new() } - } else { + } else if !ws.is_local() { format!( "Either upgrade to rustc {} or newer, or use\n\ cargo update -p {}@{} --precise ver\n\ @@ -678,6 +678,8 @@ pub fn create_bcx<'a, 'cfg>( unit.pkg.name(), current_version, ) + } else { + String::new() }; anyhow::bail!(