Code compiles on playground but fails when passed via stdin to rustc
Rust Internals [Unofficial]
June 19, 2026
It does. It used to be conditional, but that was 5 years ago.
github.com/rust-lang/cargo
src/cargo/core/compiler/mod.rs
master
1261. if unit.show_warnings(bcx.gctx) {
1262. warn(msg)
1263. } else {
1264. Ok(())
1265. }
1266. };
1267.
1268. cmd.arg("--crate-name").arg(&unit.target.crate_name());
1269.
1270. let edition = unit.target.edition();
1271. edition.cmd_edition_arg(cmd);
1272.
1273. add_path_args(bcx.ws, unit, cmd);
1274. add_error_format_and_color(build_runner, cmd);
1275. add_allow_features(build_runner, cmd);
1276.
1277. let mut contains_dy_lib = false;
1278. if !test {
1279. for crate_type in &unit.target.rustc_crate_types() {
1280. cmd.arg("--crate-type").arg(crate_type.as_str());
1281. contains_dy_lib |= crate_type == &CrateType::Dylib;
Discussion in the ATmosphere