Auto merge of #17296 - mathew-horner:no-clone-target, r=Veykril · rust-lang/rust@f7ca8a6 (original) (raw)

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ impl RunnableKind {
79 79
80 80 impl Runnable {
81 81 // test package::module::testname
82 -pub fn label(&self, target: Option<String>) -> String {
82 +pub fn label(&self, target: Option<&str>) -> String {
83 83 match &self.kind {
84 84 RunnableKind::Test { test_id, .. } => format!("test {test_id}"),
85 85 RunnableKind::TestMod { path } => format!("test-mod {path}"),
Original file line number Diff line number Diff line change
@@ -1364,10 +1364,10 @@ pub(crate) fn runnable(
1364 1364 ide::RunnableKind::Bin { .. } => workspace_root.clone().map(|it
1365 1365 _ => spec.as_ref().map(|it
1366 1366 };
1367 -let target = spec.as_ref().map(|s
1367 +let target = spec.as_ref().map(|s
1368 +let label = runnable.label(target);
1368 1369 let (cargo_args, executable_args) =
1369 1370 CargoTargetSpec::runnable_args(snap, spec, &runnable.kind, &runnable.cfg);
1370 -let label = runnable.label(target);
1371 1371 let location = location_link(snap, None, runnable.nav)?;
1372 1372
1373 1373 Ok(lsp_ext::Runnable {