Skip to content

Commit c0396fe

Browse files
authored
make UnitGenerator public in cargo-as-a-library (#15873)
### What does this PR try to resolve? This PR makes `UnitGenerator` public for experimenting with unit graph generation in cargo plumbing commands. See crate-ci/cargo-plumbing#39 ### How to test and review this PR? Verify that `UnitGenerator` is available when using cargo-as-a-library
2 parents 81db0af + e633ba3 commit c0396fe

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/cargo/ops/cargo_compile/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use crate::util::{CargoResult, StableHasher};
6060
mod compile_filter;
6161
pub use compile_filter::{CompileFilter, FilterRule, LibRule};
6262

63-
mod unit_generator;
63+
pub(super) mod unit_generator;
6464
use unit_generator::UnitGenerator;
6565

6666
mod packages;

src/cargo/ops/cargo_compile/unit_generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct Proposal<'a> {
4646
/// [`generate_root_units`]: UnitGenerator::generate_root_units
4747
/// [`build_unit_dependencies`]: crate::core::compiler::unit_dependencies::build_unit_dependencies
4848
/// [`UnitGraph`]: crate::core::compiler::unit_graph::UnitGraph
49-
pub(super) struct UnitGenerator<'a, 'gctx> {
49+
pub struct UnitGenerator<'a, 'gctx> {
5050
pub ws: &'a Workspace<'gctx>,
5151
pub packages: &'a [&'a Package],
5252
pub spec: &'a Packages,

src/cargo/ops/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::sources::CRATES_IO_DOMAIN;
22

33
pub use self::cargo_clean::{CleanContext, CleanOptions, clean};
4+
pub use self::cargo_compile::unit_generator::UnitGenerator;
45
pub use self::cargo_compile::{CompileFilter, FilterRule, LibRule, Packages};
56
pub use self::cargo_compile::{
67
CompileOptions, compile, compile_with_exec, compile_ws, create_bcx, print, resolve_all_features,

0 commit comments

Comments
 (0)