cargotest/support: remove internal mutability in favor of switching types
authorNODA, Kai <nodakai@gmail.com>
Sat, 22 Jul 2017 03:12:21 +0000 (11:12 +0800)
committerNODA, Kai <nodakai@gmail.com>
Tue, 10 Oct 2017 08:47:12 +0000 (16:47 +0800)
commitd43ee1dd22eb37c2515a8309331e4600ea6ecdb3
tree3c77238a0d162b1f419661017d514cee5f97ad66
parent463e850146e9454b8b953ff73772a35b286b58e7
cargotest/support: remove internal mutability in favor of switching types

Remove is_build: Cell<bool> from ProjectBuilder and introduce a new type Project.

is_build==false <-> ProjectBuilder
is_build==true <-> Project

Also add #[must_use] to ProjectBuilder to confirm its instances are surely consumed by its build() method to produce Project.

The same goes for RepoBuilder.

ProjectBuilder::cargo_process() was removed as its design heavily depended on the internal mutability.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
62 files changed:
tests/bad-config.rs
tests/bad-manifest-path.rs
tests/bench.rs
tests/build-auth.rs
tests/build-lib.rs
tests/build-script-env.rs
tests/build-script.rs
tests/build.rs
tests/cargo-features.rs
tests/cargo.rs
tests/cargo_alias_config.rs
tests/cargotest/support/cross_compile.rs
tests/cargotest/support/git.rs
tests/cargotest/support/mod.rs
tests/cargotest/support/publish.rs
tests/cargotest/support/registry.rs
tests/cfg.rs
tests/check.rs
tests/clean.rs
tests/concurrent.rs
tests/config.rs
tests/cross-compile.rs
tests/cross-publish.rs
tests/death.rs
tests/dep-info.rs
tests/directory.rs
tests/doc.rs
tests/features.rs
tests/fetch.rs
tests/freshness.rs
tests/generate-lockfile.rs
tests/git.rs
tests/install.rs
tests/jobserver.rs
tests/local-registry.rs
tests/lockfile-compat.rs
tests/metadata.rs
tests/net-config.rs
tests/overrides.rs
tests/package.rs
tests/patch.rs
tests/path.rs
tests/plugins.rs
tests/proc-macro.rs
tests/profiles.rs
tests/publish.rs
tests/read-manifest.rs
tests/registry.rs
tests/required-features.rs
tests/run.rs
tests/rustc.rs
tests/rustdoc.rs
tests/rustdocflags.rs
tests/rustflags.rs
tests/search.rs
tests/small-fd-limits.rs
tests/test.rs
tests/tool-paths.rs
tests/verify-project.rs
tests/version.rs
tests/warn-on-failure.rs
tests/workspaces.rs