Skip to content

Commit

Permalink
Remove DontDistWithMiri struct and instead just directly check it in …
Browse files Browse the repository at this point in the history
…builder
  • Loading branch information
Mark-Simulacrum committed Feb 11, 2018
1 parent 11580b7 commit 55c36e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
9 changes: 7 additions & 2 deletions src/bootstrap/builder.rs
Expand Up @@ -286,8 +286,7 @@ impl<'a> Builder<'a> {
doc::Reference, doc::Rustdoc, doc::RustByExample, doc::CargoBook),
Kind::Dist => describe!(dist::Docs, dist::Mingw, dist::Rustc, dist::DebuggerScripts,
dist::Std, dist::Analysis, dist::Src, dist::PlainSourceTarball, dist::Cargo,
dist::Rls, dist::Rustfmt, dist::Extended, dist::HashSign,
dist::DontDistWithMiriEnabled),
dist::Rls, dist::Rustfmt, dist::Extended, dist::HashSign),
Kind::Install => describe!(install::Docs, install::Std, install::Cargo, install::Rls,
install::Rustfmt, install::Analysis, install::Src, install::Rustc),
}
Expand Down Expand Up @@ -344,6 +343,12 @@ impl<'a> Builder<'a> {
stack: RefCell::new(Vec::new()),
};

if kind == Kind::Dist {
assert!(!build.config.test_miri, "Do not distribute with miri enabled.\n\
The distributed libraries would include all MIR (increasing binary size).
The distributed MIR would include validation statements.");
}

StepDescription::run(&Builder::get_step_descriptions(builder.kind), &builder, paths);
}

Expand Down
25 changes: 0 additions & 25 deletions src/bootstrap/dist.rs
Expand Up @@ -1233,31 +1233,6 @@ impl Step for Rustfmt {
}
}


#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct DontDistWithMiriEnabled;

impl Step for DontDistWithMiriEnabled {
type Output = PathBuf;
const DEFAULT: bool = true;

fn should_run(run: ShouldRun) -> ShouldRun {
let build_miri = run.builder.build.config.test_miri;
run.default_condition(build_miri)
}

fn make_run(run: RunConfig) {
run.builder.ensure(DontDistWithMiriEnabled);
}

fn run(self, _: &Builder) -> PathBuf {
panic!("Do not distribute with miri enabled.\n\
The distributed libraries would include all MIR (increasing binary size).
The distributed MIR would include validation statements.");
}
}


#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Extended {
stage: u32,
Expand Down

0 comments on commit 55c36e3

Please sign in to comment.