@@ -11,7 +11,7 @@ use crate::core::compiler::apply_env_config;
1111use crate :: core:: compiler:: {
1212 BuildOutput , CompileKind , CompileMode , CompileTarget , Context , CrateType ,
1313} ;
14- use crate :: core:: { Dependency , Package , Target , TargetKind , Workspace } ;
14+ use crate :: core:: { Dependency , Target , TargetKind , Workspace } ;
1515use crate :: util:: config:: { Config , StringList , TargetConfig } ;
1616use crate :: util:: interning:: InternedString ;
1717use crate :: util:: { CargoResult , Rustc } ;
@@ -910,39 +910,15 @@ impl<'cfg> RustcTargetData<'cfg> {
910910 target_info,
911911 } ;
912912
913- // Get all kinds we currently know about.
914- //
915- // For now, targets can only ever come from the root workspace
916- // units and artifact dependencies, so this
917- // correctly represents all the kinds that can happen. When we have
918- // other ways for targets to appear at places that are not the root units,
919- // we may have to revisit this.
920- fn artifact_targets ( package : & Package ) -> impl Iterator < Item = CompileKind > + ' _ {
921- package
922- . manifest ( )
923- . dependencies ( )
924- . iter ( )
925- . filter_map ( |d| d. artifact ( ) ?. target ( ) ?. to_compile_kind ( ) )
926- }
927- let all_kinds = requested_kinds
928- . iter ( )
929- . copied ( )
930- . chain ( ws. members ( ) . flat_map ( |p| {
931- p. manifest ( )
932- . default_kind ( )
933- . into_iter ( )
934- . chain ( p. manifest ( ) . forced_kind ( ) )
935- . chain ( artifact_targets ( p) )
936- } ) ) ;
937- for kind in all_kinds {
913+ for & kind in requested_kinds {
938914 res. merge_compile_kind ( kind) ?;
939915 }
940916
941917 Ok ( res)
942918 }
943919
944920 /// Insert `kind` into our `target_info` and `target_config` members if it isn't present yet.
945- fn merge_compile_kind ( & mut self , kind : CompileKind ) -> CargoResult < ( ) > {
921+ pub ( crate ) fn merge_compile_kind ( & mut self , kind : CompileKind ) -> CargoResult < ( ) > {
946922 if let CompileKind :: Target ( target) = kind {
947923 if !self . target_config . contains_key ( & target) {
948924 self . target_config
0 commit comments