1use std::collections::{HashMap, HashSet};
39use std::hash::{Hash, Hasher};
40use std::sync::Arc;
41
42use crate::core::compiler::unit_dependencies::build_unit_dependencies;
43use crate::core::compiler::unit_graph::{self, UnitDep, UnitGraph};
44use crate::core::compiler::{apply_env_config, standard_lib, CrateType, TargetInfo};
45use crate::core::compiler::{BuildConfig, BuildContext, BuildRunner, Compilation};
46use crate::core::compiler::{CompileKind, CompileMode, CompileTarget, RustcTargetData, Unit};
47use crate::core::compiler::{DefaultExecutor, Executor, UnitInterner};
48use crate::core::profiles::Profiles;
49use crate::core::resolver::features::{self, CliFeatures, FeaturesFor};
50use crate::core::resolver::{HasDevUnits, Resolve};
51use crate::core::{PackageId, PackageSet, SourceId, TargetKind, Workspace};
52use crate::drop_println;
53use crate::ops;
54use crate::ops::resolve::WorkspaceResolve;
55use crate::util::context::{GlobalContext, WarningHandling};
56use crate::util::interning::InternedString;
57use crate::util::{CargoResult, StableHasher};
58
59mod compile_filter;
60pub use compile_filter::{CompileFilter, FilterRule, LibRule};
61
62mod unit_generator;
63use unit_generator::UnitGenerator;
64
65mod packages;
66
67pub use packages::Packages;
68
69#[derive(Debug, Clone)]
78pub struct CompileOptions {
79 pub build_config: BuildConfig,
81 pub cli_features: CliFeatures,
83 pub spec: Packages,
85 pub filter: CompileFilter,
88 pub target_rustdoc_args: Option<Vec<String>>,
90 pub target_rustc_args: Option<Vec<String>>,
93 pub target_rustc_crate_types: Option<Vec<String>>,
95 pub rustdoc_document_private_items: bool,
98 pub honor_rust_version: Option<bool>,
101}
102
103impl CompileOptions {
104 pub fn new(gctx: &GlobalContext, mode: CompileMode) -> CargoResult<CompileOptions> {
105 let jobs = None;
106 let keep_going = false;
107 Ok(CompileOptions {
108 build_config: BuildConfig::new(gctx, jobs, keep_going, &[], mode)?,
109 cli_features: CliFeatures::new_all(false),
110 spec: ops::Packages::Packages(Vec::new()),
111 filter: CompileFilter::Default {
112 required_features_filterable: false,
113 },
114 target_rustdoc_args: None,
115 target_rustc_args: None,
116 target_rustc_crate_types: None,
117 rustdoc_document_private_items: false,
118 honor_rust_version: None,
119 })
120 }
121}
122
123pub fn compile<'a>(ws: &Workspace<'a>, options: &CompileOptions) -> CargoResult<Compilation<'a>> {
127 let exec: Arc<dyn Executor> = Arc::new(DefaultExecutor);
128 compile_with_exec(ws, options, &exec)
129}
130
131pub fn compile_with_exec<'a>(
136 ws: &Workspace<'a>,
137 options: &CompileOptions,
138 exec: &Arc<dyn Executor>,
139) -> CargoResult<Compilation<'a>> {
140 ws.emit_warnings()?;
141 let compilation = compile_ws(ws, options, exec)?;
142 if ws.gctx().warning_handling()? == WarningHandling::Deny && compilation.warning_count > 0 {
143 anyhow::bail!("warnings are denied by `build.warnings` configuration")
144 }
145 Ok(compilation)
146}
147
148#[tracing::instrument(skip_all)]
150pub fn compile_ws<'a>(
151 ws: &Workspace<'a>,
152 options: &CompileOptions,
153 exec: &Arc<dyn Executor>,
154) -> CargoResult<Compilation<'a>> {
155 let interner = UnitInterner::new();
156 let bcx = create_bcx(ws, options, &interner)?;
157 if options.build_config.unit_graph {
158 unit_graph::emit_serialized_unit_graph(&bcx.roots, &bcx.unit_graph, ws.gctx())?;
159 return Compilation::new(&bcx);
160 }
161 crate::core::gc::auto_gc(bcx.gctx);
162 let build_runner = BuildRunner::new(&bcx)?;
163 if options.build_config.dry_run {
164 build_runner.dry_run()
165 } else {
166 build_runner.compile(exec)
167 }
168}
169
170pub fn print<'a>(
174 ws: &Workspace<'a>,
175 options: &CompileOptions,
176 print_opt_value: &str,
177) -> CargoResult<()> {
178 let CompileOptions {
179 ref build_config,
180 ref target_rustc_args,
181 ..
182 } = *options;
183 let gctx = ws.gctx();
184 let rustc = gctx.load_global_rustc(Some(ws))?;
185 for (index, kind) in build_config.requested_kinds.iter().enumerate() {
186 if index != 0 {
187 drop_println!(gctx);
188 }
189 let target_info = TargetInfo::new(gctx, &build_config.requested_kinds, &rustc, *kind)?;
190 let mut process = rustc.process();
191 apply_env_config(gctx, &mut process)?;
192 process.args(&target_info.rustflags);
193 if let Some(args) = target_rustc_args {
194 process.args(args);
195 }
196 if let CompileKind::Target(t) = kind {
197 process.arg("--target").arg(t.rustc_target());
198 }
199 process.arg("--print").arg(print_opt_value);
200 process.exec()?;
201 }
202 Ok(())
203}
204
205#[tracing::instrument(skip_all)]
210pub fn create_bcx<'a, 'gctx>(
211 ws: &'a Workspace<'gctx>,
212 options: &'a CompileOptions,
213 interner: &'a UnitInterner,
214) -> CargoResult<BuildContext<'a, 'gctx>> {
215 let CompileOptions {
216 ref build_config,
217 ref spec,
218 ref cli_features,
219 ref filter,
220 ref target_rustdoc_args,
221 ref target_rustc_args,
222 ref target_rustc_crate_types,
223 rustdoc_document_private_items,
224 honor_rust_version,
225 } = *options;
226 let gctx = ws.gctx();
227
228 match build_config.mode {
230 CompileMode::Test
231 | CompileMode::Build
232 | CompileMode::Check { .. }
233 | CompileMode::Bench
234 | CompileMode::RunCustomBuild => {
235 if ws.gctx().get_env("RUST_FLAGS").is_ok() {
236 gctx.shell().warn(
237 "Cargo does not read `RUST_FLAGS` environment variable. Did you mean `RUSTFLAGS`?",
238 )?;
239 }
240 }
241 CompileMode::Doc { .. } | CompileMode::Doctest | CompileMode::Docscrape => {
242 if ws.gctx().get_env("RUSTDOC_FLAGS").is_ok() {
243 gctx.shell().warn(
244 "Cargo does not read `RUSTDOC_FLAGS` environment variable. Did you mean `RUSTDOCFLAGS`?"
245 )?;
246 }
247 }
248 }
249 gctx.validate_term_config()?;
250
251 let mut target_data = RustcTargetData::new(ws, &build_config.requested_kinds)?;
252
253 let specs = spec.to_package_id_specs(ws)?;
254 let has_dev_units = {
255 let any_pkg_has_scrape_enabled = ws
259 .members_with_features(&specs, cli_features)?
260 .iter()
261 .any(|(pkg, _)| {
262 pkg.targets()
263 .iter()
264 .any(|target| target.is_example() && target.doc_scrape_examples().is_enabled())
265 });
266
267 if filter.need_dev_deps(build_config.mode)
268 || (build_config.mode.is_doc() && any_pkg_has_scrape_enabled)
269 {
270 HasDevUnits::Yes
271 } else {
272 HasDevUnits::No
273 }
274 };
275 let dry_run = false;
276 let resolve = ops::resolve_ws_with_opts(
277 ws,
278 &mut target_data,
279 &build_config.requested_kinds,
280 cli_features,
281 &specs,
282 has_dev_units,
283 crate::core::resolver::features::ForceAllTargets::No,
284 dry_run,
285 )?;
286 let WorkspaceResolve {
287 mut pkg_set,
288 workspace_resolve,
289 targeted_resolve: resolve,
290 resolved_features,
291 } = resolve;
292
293 let std_resolve_features = if let Some(crates) = &gctx.cli_unstable().build_std {
294 let (std_package_set, std_resolve, std_features) = standard_lib::resolve_std(
295 ws,
296 &mut target_data,
297 &build_config,
298 crates,
299 &build_config.requested_kinds,
300 )?;
301 pkg_set.add_set(std_package_set);
302 Some((std_resolve, std_features))
303 } else {
304 None
305 };
306
307 let to_build_ids = resolve.specs_to_ids(&specs)?;
311 let mut to_builds = pkg_set.get_many(to_build_ids)?;
315
316 to_builds.sort_by_key(|p| p.package_id());
320
321 for pkg in to_builds.iter() {
322 pkg.manifest().print_teapot(gctx);
323
324 if build_config.mode.is_any_test()
325 && !ws.is_member(pkg)
326 && pkg.dependencies().iter().any(|dep| !dep.is_transitive())
327 {
328 anyhow::bail!(
329 "package `{}` cannot be tested because it requires dev-dependencies \
330 and is not a member of the workspace",
331 pkg.name()
332 );
333 }
334 }
335
336 let (extra_args, extra_args_name) = match (target_rustc_args, target_rustdoc_args) {
337 (Some(args), _) => (Some(args.clone()), "rustc"),
338 (_, Some(args)) => (Some(args.clone()), "rustdoc"),
339 _ => (None, ""),
340 };
341
342 if extra_args.is_some() && to_builds.len() != 1 {
343 panic!(
344 "`{}` should not accept multiple `-p` flags",
345 extra_args_name
346 );
347 }
348
349 let profiles = Profiles::new(ws, build_config.requested_profile)?;
350 profiles.validate_packages(
351 ws.profiles(),
352 &mut gctx.shell(),
353 workspace_resolve.as_ref().unwrap_or(&resolve),
354 )?;
355
356 let explicit_host_kind = CompileKind::Target(CompileTarget::new(&target_data.rustc.host)?);
360 let explicit_host_kinds: Vec<_> = build_config
361 .requested_kinds
362 .iter()
363 .map(|kind| match kind {
364 CompileKind::Host => explicit_host_kind,
365 CompileKind::Target(t) => CompileKind::Target(*t),
366 })
367 .collect();
368
369 let generator = UnitGenerator {
375 ws,
376 packages: &to_builds,
377 target_data: &target_data,
378 filter,
379 requested_kinds: &build_config.requested_kinds,
380 explicit_host_kind,
381 mode: build_config.mode,
382 resolve: &resolve,
383 workspace_resolve: &workspace_resolve,
384 resolved_features: &resolved_features,
385 package_set: &pkg_set,
386 profiles: &profiles,
387 interner,
388 has_dev_units,
389 };
390 let mut units = generator.generate_root_units()?;
391
392 if let Some(args) = target_rustc_crate_types {
393 override_rustc_crate_types(&mut units, args, interner)?;
394 }
395
396 let should_scrape = build_config.mode.is_doc() && gctx.cli_unstable().rustdoc_scrape_examples;
397 let mut scrape_units = if should_scrape {
398 UnitGenerator {
399 mode: CompileMode::Docscrape,
400 ..generator
401 }
402 .generate_scrape_units(&units)?
403 } else {
404 Vec::new()
405 };
406
407 let std_roots = if let Some(crates) = gctx.cli_unstable().build_std.as_ref() {
408 let (std_resolve, std_features) = std_resolve_features.as_ref().unwrap();
409 standard_lib::generate_std_roots(
410 &crates,
411 &units,
412 std_resolve,
413 std_features,
414 &explicit_host_kinds,
415 &pkg_set,
416 interner,
417 &profiles,
418 &target_data,
419 )?
420 } else {
421 Default::default()
422 };
423
424 let mut unit_graph = build_unit_dependencies(
425 ws,
426 &pkg_set,
427 &resolve,
428 &resolved_features,
429 std_resolve_features.as_ref(),
430 &units,
431 &scrape_units,
432 &std_roots,
433 build_config.mode,
434 &target_data,
435 &profiles,
436 interner,
437 )?;
438
439 if matches!(build_config.mode, CompileMode::Doc { deps: true, .. }) {
442 remove_duplicate_doc(build_config, &units, &mut unit_graph);
443 }
444
445 let host_kind_requested = build_config
446 .requested_kinds
447 .iter()
448 .any(CompileKind::is_host);
449 (units, scrape_units, unit_graph) = rebuild_unit_graph_shared(
453 interner,
454 unit_graph,
455 &units,
456 &scrape_units,
457 host_kind_requested.then_some(explicit_host_kind),
458 );
459
460 let mut extra_compiler_args = HashMap::new();
461 if let Some(args) = extra_args {
462 if units.len() != 1 {
463 anyhow::bail!(
464 "extra arguments to `{}` can only be passed to one \
465 target, consider filtering\nthe package by passing, \
466 e.g., `--lib` or `--bin NAME` to specify a single target",
467 extra_args_name
468 );
469 }
470 extra_compiler_args.insert(units[0].clone(), args);
471 }
472
473 for unit in units
474 .iter()
475 .filter(|unit| unit.mode.is_doc() || unit.mode.is_doc_test())
476 .filter(|unit| rustdoc_document_private_items || unit.target.is_bin())
477 {
478 let mut args = vec!["--document-private-items".into()];
482 if unit.target.is_bin() {
483 args.push("-Arustdoc::private-intra-doc-links".into());
487 }
488 extra_compiler_args
489 .entry(unit.clone())
490 .or_default()
491 .extend(args);
492 }
493
494 if honor_rust_version.unwrap_or(true) {
495 let rustc_version = target_data.rustc.version.clone().into();
496
497 let mut incompatible = Vec::new();
498 let mut local_incompatible = false;
499 for unit in unit_graph.keys() {
500 let Some(pkg_msrv) = unit.pkg.rust_version() else {
501 continue;
502 };
503
504 if pkg_msrv.is_compatible_with(&rustc_version) {
505 continue;
506 }
507
508 local_incompatible |= unit.is_local();
509 incompatible.push((unit, pkg_msrv));
510 }
511 if !incompatible.is_empty() {
512 use std::fmt::Write as _;
513
514 let plural = if incompatible.len() == 1 { "" } else { "s" };
515 let mut message = format!(
516 "rustc {rustc_version} is not supported by the following package{plural}:\n"
517 );
518 incompatible.sort_by_key(|(unit, _)| (unit.pkg.name(), unit.pkg.version()));
519 for (unit, msrv) in incompatible {
520 let name = &unit.pkg.name();
521 let version = &unit.pkg.version();
522 writeln!(&mut message, " {name}@{version} requires rustc {msrv}").unwrap();
523 }
524 if ws.is_ephemeral() {
525 if ws.ignore_lock() {
526 writeln!(
527 &mut message,
528 "Try re-running `cargo install` with `--locked`"
529 )
530 .unwrap();
531 }
532 } else if !local_incompatible {
533 writeln!(
534 &mut message,
535 "Either upgrade rustc or select compatible dependency versions with
536`cargo update <name>@<current-ver> --precise <compatible-ver>`
537where `<compatible-ver>` is the latest version supporting rustc {rustc_version}",
538 )
539 .unwrap();
540 }
541 return Err(anyhow::Error::msg(message));
542 }
543 }
544
545 let bcx = BuildContext::new(
546 ws,
547 pkg_set,
548 build_config,
549 profiles,
550 extra_compiler_args,
551 target_data,
552 units,
553 unit_graph,
554 scrape_units,
555 )?;
556
557 Ok(bcx)
558}
559
560fn rebuild_unit_graph_shared(
592 interner: &UnitInterner,
593 unit_graph: UnitGraph,
594 roots: &[Unit],
595 scrape_units: &[Unit],
596 to_host: Option<CompileKind>,
597) -> (Vec<Unit>, Vec<Unit>, UnitGraph) {
598 let mut result = UnitGraph::new();
599 let mut memo = HashMap::new();
602 let new_roots = roots
603 .iter()
604 .map(|root| {
605 traverse_and_share(
606 interner,
607 &mut memo,
608 &mut result,
609 &unit_graph,
610 root,
611 false,
612 to_host,
613 )
614 })
615 .collect();
616 let new_scrape_units = scrape_units
620 .iter()
621 .map(|unit| memo.get(unit).unwrap().clone())
622 .collect();
623 (new_roots, new_scrape_units, result)
624}
625
626fn traverse_and_share(
632 interner: &UnitInterner,
633 memo: &mut HashMap<Unit, Unit>,
634 new_graph: &mut UnitGraph,
635 unit_graph: &UnitGraph,
636 unit: &Unit,
637 unit_is_for_host: bool,
638 to_host: Option<CompileKind>,
639) -> Unit {
640 if let Some(new_unit) = memo.get(unit) {
641 return new_unit.clone();
643 }
644 let mut dep_hash = StableHasher::new();
645 let new_deps: Vec<_> = unit_graph[unit]
646 .iter()
647 .map(|dep| {
648 let new_dep_unit = traverse_and_share(
649 interner,
650 memo,
651 new_graph,
652 unit_graph,
653 &dep.unit,
654 dep.unit_for.is_for_host(),
655 to_host,
656 );
657 new_dep_unit.hash(&mut dep_hash);
658 UnitDep {
659 unit: new_dep_unit,
660 ..dep.clone()
661 }
662 })
663 .collect();
664 let new_dep_hash = Hasher::finish(&dep_hash);
667
668 let canonical_kind = match to_host {
675 Some(to_host) if to_host == unit.kind => CompileKind::Host,
676 _ => unit.kind,
677 };
678
679 let mut profile = unit.profile.clone();
680 if profile.strip.is_deferred() {
681 if !profile.debuginfo.is_turned_on()
685 && new_deps
686 .iter()
687 .all(|dep| !dep.unit.profile.debuginfo.is_turned_on())
688 {
689 profile.strip = profile.strip.strip_debuginfo();
690 }
691 }
692
693 if unit_is_for_host
697 && to_host.is_some()
698 && profile.debuginfo.is_deferred()
699 && !unit.artifact.is_true()
700 {
701 let canonical_debuginfo = profile.debuginfo.finalize();
705 let mut canonical_profile = profile.clone();
706 canonical_profile.debuginfo = canonical_debuginfo;
707 let unit_probe = interner.intern(
708 &unit.pkg,
709 &unit.target,
710 canonical_profile,
711 to_host.unwrap(),
712 unit.mode,
713 unit.features.clone(),
714 unit.rustflags.clone(),
715 unit.rustdocflags.clone(),
716 unit.links_overrides.clone(),
717 unit.is_std,
718 unit.dep_hash,
719 unit.artifact,
720 unit.artifact_target_for_features,
721 );
722
723 profile.debuginfo = if unit_graph.contains_key(&unit_probe) {
725 canonical_debuginfo
728 } else {
729 canonical_debuginfo.weaken()
732 }
733 }
734
735 let new_unit = interner.intern(
736 &unit.pkg,
737 &unit.target,
738 profile,
739 canonical_kind,
740 unit.mode,
741 unit.features.clone(),
742 unit.rustflags.clone(),
743 unit.rustdocflags.clone(),
744 unit.links_overrides.clone(),
745 unit.is_std,
746 new_dep_hash,
747 unit.artifact,
748 None,
751 );
752 assert!(memo.insert(unit.clone(), new_unit.clone()).is_none());
753 new_graph.entry(new_unit.clone()).or_insert(new_deps);
754 new_unit
755}
756
757fn remove_duplicate_doc(
773 build_config: &BuildConfig,
774 root_units: &[Unit],
775 unit_graph: &mut UnitGraph,
776) {
777 let mut all_docs: HashMap<String, Vec<Unit>> = HashMap::new();
780 for unit in unit_graph.keys() {
781 if unit.mode.is_doc() {
782 all_docs
783 .entry(unit.target.crate_name())
784 .or_default()
785 .push(unit.clone());
786 }
787 }
788 let mut removed_units: HashSet<Unit> = HashSet::new();
791 let mut remove = |units: Vec<Unit>, reason: &str, cb: &dyn Fn(&Unit) -> bool| -> Vec<Unit> {
792 let (to_remove, remaining_units): (Vec<Unit>, Vec<Unit>) = units
793 .into_iter()
794 .partition(|unit| cb(unit) && !root_units.contains(unit));
795 for unit in to_remove {
796 tracing::debug!(
797 "removing duplicate doc due to {} for package {} target `{}`",
798 reason,
799 unit.pkg,
800 unit.target.name()
801 );
802 unit_graph.remove(&unit);
803 removed_units.insert(unit);
804 }
805 remaining_units
806 };
807 for (_crate_name, mut units) in all_docs {
809 if units.len() == 1 {
810 continue;
811 }
812 if build_config
814 .requested_kinds
815 .iter()
816 .all(CompileKind::is_host)
817 {
818 units = remove(units, "host/target merger", &|unit| unit.kind.is_host());
823 if units.len() == 1 {
824 continue;
825 }
826 }
827 let mut source_map: HashMap<(InternedString, SourceId, CompileKind), Vec<Unit>> =
829 HashMap::new();
830 for unit in units {
831 let pkg_id = unit.pkg.package_id();
832 source_map
834 .entry((pkg_id.name(), pkg_id.source_id(), unit.kind))
835 .or_default()
836 .push(unit);
837 }
838 let mut remaining_units = Vec::new();
839 for (_key, mut units) in source_map {
840 if units.len() > 1 {
841 units.sort_by(|a, b| a.pkg.version().partial_cmp(b.pkg.version()).unwrap());
842 let newest_version = units.last().unwrap().pkg.version().clone();
844 let keep_units = remove(units, "older version", &|unit| {
845 unit.pkg.version() < &newest_version
846 });
847 remaining_units.extend(keep_units);
848 } else {
849 remaining_units.extend(units);
850 }
851 }
852 if remaining_units.len() == 1 {
853 continue;
854 }
855 }
858 for unit_deps in unit_graph.values_mut() {
860 unit_deps.retain(|unit_dep| !removed_units.contains(&unit_dep.unit));
861 }
862 let mut visited = HashSet::new();
864 fn visit(unit: &Unit, graph: &UnitGraph, visited: &mut HashSet<Unit>) {
865 if !visited.insert(unit.clone()) {
866 return;
867 }
868 for dep in &graph[unit] {
869 visit(&dep.unit, graph, visited);
870 }
871 }
872 for unit in root_units {
873 visit(unit, unit_graph, &mut visited);
874 }
875 unit_graph.retain(|unit, _| visited.contains(unit));
876}
877
878fn override_rustc_crate_types(
882 units: &mut [Unit],
883 args: &[String],
884 interner: &UnitInterner,
885) -> CargoResult<()> {
886 if units.len() != 1 {
887 anyhow::bail!(
888 "crate types to rustc can only be passed to one \
889 target, consider filtering\nthe package by passing, \
890 e.g., `--lib` or `--example` to specify a single target"
891 );
892 }
893
894 let unit = &units[0];
895 let override_unit = |f: fn(Vec<CrateType>) -> TargetKind| {
896 let crate_types = args.iter().map(|s| s.into()).collect();
897 let mut target = unit.target.clone();
898 target.set_kind(f(crate_types));
899 interner.intern(
900 &unit.pkg,
901 &target,
902 unit.profile.clone(),
903 unit.kind,
904 unit.mode,
905 unit.features.clone(),
906 unit.rustflags.clone(),
907 unit.rustdocflags.clone(),
908 unit.links_overrides.clone(),
909 unit.is_std,
910 unit.dep_hash,
911 unit.artifact,
912 unit.artifact_target_for_features,
913 )
914 };
915 units[0] = match unit.target.kind() {
916 TargetKind::Lib(_) => override_unit(TargetKind::Lib),
917 TargetKind::ExampleLib(_) => override_unit(TargetKind::ExampleLib),
918 _ => {
919 anyhow::bail!(
920 "crate types can only be specified for libraries and example libraries.\n\
921 Binaries, tests, and benchmarks are always the `bin` crate type"
922 );
923 }
924 };
925
926 Ok(())
927}
928
929pub fn resolve_all_features(
935 resolve_with_overrides: &Resolve,
936 resolved_features: &features::ResolvedFeatures,
937 package_set: &PackageSet<'_>,
938 package_id: PackageId,
939) -> HashSet<String> {
940 let mut features: HashSet<String> = resolved_features
941 .activated_features(package_id, FeaturesFor::NormalOrDev)
942 .iter()
943 .map(|s| s.to_string())
944 .collect();
945
946 for (dep_id, deps) in resolve_with_overrides.deps(package_id) {
949 let is_proc_macro = package_set
950 .get_one(dep_id)
951 .expect("packages downloaded")
952 .proc_macro();
953 for dep in deps {
954 let features_for = FeaturesFor::from_for_host(is_proc_macro || dep.is_build());
955 for feature in resolved_features
956 .activated_features_unverified(dep_id, features_for)
957 .unwrap_or_default()
958 {
959 features.insert(format!("{}/{}", dep.name_in_toml(), feature));
960 }
961 }
962 }
963
964 features
965}