35
35
//! [`drain_the_queue`]: crate::core::compiler::job_queue
36
36
//! ["Cargo Target"]: https://doc.rust-lang.org/nightly/cargo/reference/cargo-targets.html
37
37
38
- use cargo_platform:: Cfg ;
39
38
use std:: collections:: { HashMap , HashSet } ;
40
39
use std:: hash:: { Hash , Hasher } ;
41
40
use std:: sync:: Arc ;
@@ -439,7 +438,6 @@ pub fn create_bcx<'a, 'gctx>(
439
438
& units,
440
439
& scrape_units,
441
440
host_kind_requested. then_some ( explicit_host_kind) ,
442
- & target_data,
443
441
) ;
444
442
445
443
let mut extra_compiler_args = HashMap :: new ( ) ;
@@ -579,7 +577,6 @@ fn rebuild_unit_graph_shared(
579
577
roots : & [ Unit ] ,
580
578
scrape_units : & [ Unit ] ,
581
579
to_host : Option < CompileKind > ,
582
- target_data : & RustcTargetData < ' _ > ,
583
580
) -> ( Vec < Unit > , Vec < Unit > , UnitGraph ) {
584
581
let mut result = UnitGraph :: new ( ) ;
585
582
// Map of the old unit to the new unit, used to avoid recursing into units
@@ -596,7 +593,6 @@ fn rebuild_unit_graph_shared(
596
593
root,
597
594
false ,
598
595
to_host,
599
- target_data,
600
596
)
601
597
} )
602
598
. collect ( ) ;
@@ -623,7 +619,6 @@ fn traverse_and_share(
623
619
unit : & Unit ,
624
620
unit_is_for_host : bool ,
625
621
to_host : Option < CompileKind > ,
626
- target_data : & RustcTargetData < ' _ > ,
627
622
) -> Unit {
628
623
if let Some ( new_unit) = memo. get ( unit) {
629
624
// Already computed, no need to recompute.
@@ -641,7 +636,6 @@ fn traverse_and_share(
641
636
& dep. unit ,
642
637
dep. unit_for . is_for_host ( ) ,
643
638
to_host,
644
- target_data,
645
639
) ;
646
640
new_dep_unit. hash ( & mut dep_hash) ;
647
641
UnitDep {
@@ -665,13 +659,8 @@ fn traverse_and_share(
665
659
_ => unit. kind ,
666
660
} ;
667
661
668
- let cfg = target_data. cfg ( unit. kind ) ;
669
- let is_target_windows_msvc = cfg. contains ( & Cfg :: Name ( "windows" . to_string ( ) ) )
670
- && cfg. contains ( & Cfg :: KeyPair ( "target_env" . to_string ( ) , "msvc" . to_string ( ) ) ) ;
671
662
let mut profile = unit. profile . clone ( ) ;
672
- // For MSVC, rustc currently treats -Cstrip=debuginfo same as -Cstrip=symbols, which causes
673
- // this optimization to also remove symbols and thus break backtraces.
674
- if profile. strip . is_deferred ( ) && !is_target_windows_msvc {
663
+ if profile. strip . is_deferred ( ) {
675
664
// If strip was not manually set, and all dependencies of this unit together
676
665
// with this unit have debuginfo turned off, we enable debuginfo stripping.
677
666
// This will remove pre-existing debug symbols coming from the standard library.
0 commit comments