Skip to content

Commit 55c36e3

Browse files
Remove DontDistWithMiri struct and instead just directly check it in builder
1 parent 11580b7 commit 55c36e3

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

src/bootstrap/builder.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ impl<'a> Builder<'a> {
286286
doc::Reference, doc::Rustdoc, doc::RustByExample, doc::CargoBook),
287287
Kind::Dist => describe!(dist::Docs, dist::Mingw, dist::Rustc, dist::DebuggerScripts,
288288
dist::Std, dist::Analysis, dist::Src, dist::PlainSourceTarball, dist::Cargo,
289-
dist::Rls, dist::Rustfmt, dist::Extended, dist::HashSign,
290-
dist::DontDistWithMiriEnabled),
289+
dist::Rls, dist::Rustfmt, dist::Extended, dist::HashSign),
291290
Kind::Install => describe!(install::Docs, install::Std, install::Cargo, install::Rls,
292291
install::Rustfmt, install::Analysis, install::Src, install::Rustc),
293292
}
@@ -344,6 +343,12 @@ impl<'a> Builder<'a> {
344343
stack: RefCell::new(Vec::new()),
345344
};
346345

346+
if kind == Kind::Dist {
347+
assert!(!build.config.test_miri, "Do not distribute with miri enabled.\n\
348+
The distributed libraries would include all MIR (increasing binary size).
349+
The distributed MIR would include validation statements.");
350+
}
351+
347352
StepDescription::run(&Builder::get_step_descriptions(builder.kind), &builder, paths);
348353
}
349354

src/bootstrap/dist.rs

-25
Original file line numberDiff line numberDiff line change
@@ -1233,31 +1233,6 @@ impl Step for Rustfmt {
12331233
}
12341234
}
12351235

1236-
1237-
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1238-
pub struct DontDistWithMiriEnabled;
1239-
1240-
impl Step for DontDistWithMiriEnabled {
1241-
type Output = PathBuf;
1242-
const DEFAULT: bool = true;
1243-
1244-
fn should_run(run: ShouldRun) -> ShouldRun {
1245-
let build_miri = run.builder.build.config.test_miri;
1246-
run.default_condition(build_miri)
1247-
}
1248-
1249-
fn make_run(run: RunConfig) {
1250-
run.builder.ensure(DontDistWithMiriEnabled);
1251-
}
1252-
1253-
fn run(self, _: &Builder) -> PathBuf {
1254-
panic!("Do not distribute with miri enabled.\n\
1255-
The distributed libraries would include all MIR (increasing binary size).
1256-
The distributed MIR would include validation statements.");
1257-
}
1258-
}
1259-
1260-
12611236
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
12621237
pub struct Extended {
12631238
stage: u32,

0 commit comments

Comments
 (0)