From 9be0b3e2bc4f9fce1a47305d0efbc674e312e09e Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Fri, 3 Feb 2023 05:29:43 +0000 Subject: [PATCH] Fix `x fix` on the standard library itself --- src/bootstrap/check.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 4b8a58e87b64e..1675ed158c9c6 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -99,6 +99,10 @@ impl Step for Std { cargo_subcommand(builder.kind), ); std_cargo(builder, target, compiler.stage, &mut cargo); + if matches!(builder.config.cmd, Subcommand::Fix { .. }) { + // By default, cargo tries to fix all targets. Tell it not to fix tests until we've added `test` to the sysroot. + cargo.arg("--lib"); + } builder.info(&format!( "Checking stage{} library artifacts ({} -> {})",