Change:
It's possible to have errors in files such as: and , and have pass. I would expect to be equivalent of and check every file that CI checks. Otherwise, I run , push code to a PR, and only find later that I have a typo or such.
We don't check tests by default, but you can pass --all-targets () to check tests. I believe this is consistent with cargo check behavior? One reason we don't check tests by default is that causes duplicate error messages for the 'base' crate typically which are annoying (and most changes don't actually need them). If Cargo handled that and didn't show duplicate messages, I imagine we could change the default as well.
Oh, you're right. So my mistake was assuming that is more thorough than it is (my text editor invokes it for me, even for tests, so I didn't realize the command doesn't do everything itself).
Just FYI, 1.55 now deduplicates messages.
Oh, great news -- in that case I'm going to go ahead and reopen this as it seems likely to make sense to check tests (by default, and likely without an option to disable that). Should be a pretty simple adjustment to bootstrap.

Discussion:
pub fn new(build: &Build) -> Builder<'_> { let (kind, paths) = match build.config.cmd { Subcommand::Build { ref paths } => (Kind::Build, &paths[..]), <del> Subcommand::Check { ref paths, all_targets: _ } => (Kind::Check, &paths[..]), </del> <ins> Subcommand::Check { ref paths } => (Kind::Check, &paths[..]), </ins> Subcommand::Clippy { ref paths, .. } => (Kind::Clippy, &paths[..]), Subcommand::Fix { ref paths } => (Kind::Fix, &paths[..]), Subcommand::Doc { ref paths, .. } => (Kind::Doc, &paths[..]),

// since we initialize with an empty sysroot. // // Currently only the "libtest" tree of crates does this. <ins> let mut cargo = builder.cargo( compiler, Mode::Std, SourceType::InTree, target, cargo_subcommand(builder.kind), ); cargo.arg("--all-targets"); std_cargo(builder, target, compiler.stage, &mut cargo); </ins> <del> if let Subcommand::Check { all_targets: true, .. } = builder.config.cmd { let mut cargo = builder.cargo( compiler, Mode::Std, SourceType::InTree, target, cargo_subcommand(builder.kind), ); std_cargo(builder, target, compiler.stage, &mut cargo); cargo.arg("--all-targets"); // Explicitly pass -p for all dependencies krates -- this will force cargo // to also check the tests/benches/examples for these crates, rather // than just the leaf crate. for krate in builder.in_tree_crates("test", Some(target)) { cargo.arg("-p").arg(krate.name); } builder.info(&format!( "Checking stage{} std test/bench/example targets ({} -> {})", builder.top_stage, &compiler.host, target )); run_cargo( builder, cargo, args(builder), &libstd_test_stamp(builder, compiler, target), vec![], true, ); </del> <ins> // Explicitly pass -p for all dependencies krates -- this will force cargo // to also check the tests/benches/examples for these crates, rather // than just the leaf crate. for krate in builder.in_tree_crates("test", Some(target)) { cargo.arg("-p").arg(krate.name); </ins> } <ins> builder.info(&format!( "Checking stage{} std test/bench/example targets ({} -> {})", builder.top_stage, &compiler.host, target )); run_cargo( builder, cargo, args(builder), &libstd_test_stamp(builder, compiler, target), vec![], true, ); </ins> } }

cargo_subcommand(builder.kind), ); rustc_cargo(builder, &mut cargo, target); <del> if let Subcommand::Check { all_targets: true, .. } = builder.config.cmd { cargo.arg("--all-targets"); } </del> <ins> cargo.arg("--all-targets"); </ins> // Explicitly pass -p for all compiler krates -- this will force cargo // to also check the tests/benches/examples for these crates, rather

$source_type, &[], ); <del> if let Subcommand::Check { all_targets: true, .. } = builder.config.cmd { cargo.arg("--all-targets"); } </del> <ins> cargo.arg("--all-targets"); </ins> // Enable internal lints for clippy and rustdoc // NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`

paths: Vec<PathBuf>, }, Check { <del> // Whether to run checking over all targets (e.g., unit / integration // tests). all_targets: bool, </del> paths: Vec<PathBuf>, }, Clippy {

let cmd = match subcommand.as_str() { "build" | "b" => Subcommand::Build { paths }, "check" | "c" => { <del> Subcommand::Check { paths, all_targets: matches.opt_present("all-targets") } </del> <ins> if matches.opt_present("all-targets") { eprintln!( "Warning: --all-targets is now on by default and does not need to be passed explicitly." ); } Subcommand::Check { paths } </ins> } "clippy" => Subcommand::Clippy { paths, fix: matches.opt_present("fix") }, "fix" => Subcommand::Fix { paths },