@@ -11,7 +11,7 @@ use crate::core::compiler::apply_env_config;
11
11
use crate :: core:: compiler:: {
12
12
BuildOutput , CompileKind , CompileMode , CompileTarget , Context , CrateType ,
13
13
} ;
14
- use crate :: core:: { Dependency , Package , Target , TargetKind , Workspace } ;
14
+ use crate :: core:: { Dependency , Target , TargetKind , Workspace } ;
15
15
use crate :: util:: config:: { Config , StringList , TargetConfig } ;
16
16
use crate :: util:: interning:: InternedString ;
17
17
use crate :: util:: { CargoResult , Rustc } ;
@@ -910,39 +910,15 @@ impl<'cfg> RustcTargetData<'cfg> {
910
910
target_info,
911
911
} ;
912
912
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 {
938
914
res. merge_compile_kind ( kind) ?;
939
915
}
940
916
941
917
Ok ( res)
942
918
}
943
919
944
920
/// 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 < ( ) > {
946
922
if let CompileKind :: Target ( target) = kind {
947
923
if !self . target_config . contains_key ( & target) {
948
924
self . target_config
0 commit comments