@@ -10,7 +10,6 @@ use crate::{early_error, early_warn, Session};
1010
1111use rustc_data_structures:: fx:: FxHashSet ;
1212use rustc_data_structures:: impl_stable_hash_via_hash;
13- use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
1413
1514use rustc_target:: abi:: { Align , TargetDataLayout } ;
1615use rustc_target:: spec:: { SplitDebuginfo , Target , TargetTriple } ;
@@ -36,66 +35,6 @@ use std::iter::{self, FromIterator};
3635use std:: path:: { Path , PathBuf } ;
3736use std:: str:: { self , FromStr } ;
3837
39- bitflags ! {
40- #[ derive( Default , Encodable , Decodable ) ]
41- pub struct SanitizerSet : u8 {
42- const ADDRESS = 1 << 0 ;
43- const LEAK = 1 << 1 ;
44- const MEMORY = 1 << 2 ;
45- const THREAD = 1 << 3 ;
46- const HWADDRESS = 1 << 4 ;
47- }
48- }
49-
50- /// Formats a sanitizer set as a comma separated list of sanitizers' names.
51- impl fmt:: Display for SanitizerSet {
52- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
53- let mut first = true ;
54- for s in * self {
55- let name = match s {
56- SanitizerSet :: ADDRESS => "address" ,
57- SanitizerSet :: LEAK => "leak" ,
58- SanitizerSet :: MEMORY => "memory" ,
59- SanitizerSet :: THREAD => "thread" ,
60- SanitizerSet :: HWADDRESS => "hwaddress" ,
61- _ => panic ! ( "unrecognized sanitizer {:?}" , s) ,
62- } ;
63- if !first {
64- f. write_str ( "," ) ?;
65- }
66- f. write_str ( name) ?;
67- first = false ;
68- }
69- Ok ( ( ) )
70- }
71- }
72-
73- impl IntoIterator for SanitizerSet {
74- type Item = SanitizerSet ;
75- type IntoIter = std:: vec:: IntoIter < SanitizerSet > ;
76-
77- fn into_iter ( self ) -> Self :: IntoIter {
78- [
79- SanitizerSet :: ADDRESS ,
80- SanitizerSet :: LEAK ,
81- SanitizerSet :: MEMORY ,
82- SanitizerSet :: THREAD ,
83- SanitizerSet :: HWADDRESS ,
84- ]
85- . iter ( )
86- . copied ( )
87- . filter ( |& s| self . contains ( s) )
88- . collect :: < Vec < _ > > ( )
89- . into_iter ( )
90- }
91- }
92-
93- impl < CTX > HashStable < CTX > for SanitizerSet {
94- fn hash_stable ( & self , ctx : & mut CTX , hasher : & mut StableHasher ) {
95- self . bits ( ) . hash_stable ( ctx, hasher) ;
96- }
97- }
98-
9938/// The different settings that the `-Z strip` flag can have.
10039#[ derive( Clone , Copy , PartialEq , Hash , Debug ) ]
10140pub enum Strip {
@@ -2308,16 +2247,16 @@ impl PpMode {
23082247crate mod dep_tracking {
23092248 use super :: {
23102249 CFGuard , CrateType , DebugInfo , ErrorOutputType , InstrumentCoverage , LinkerPluginLto ,
2311- LtoCli , OptLevel , OutputTypes , Passes , SanitizerSet , SourceFileHashAlgorithm ,
2312- SwitchWithOptPath , SymbolManglingVersion , TrimmedDefPaths ,
2250+ LtoCli , OptLevel , OutputTypes , Passes , SourceFileHashAlgorithm , SwitchWithOptPath ,
2251+ SymbolManglingVersion , TrimmedDefPaths ,
23132252 } ;
23142253 use crate :: lint;
23152254 use crate :: options:: WasiExecModel ;
23162255 use crate :: utils:: NativeLibKind ;
23172256 use rustc_feature:: UnstableFeatures ;
23182257 use rustc_span:: edition:: Edition ;
23192258 use rustc_target:: spec:: { CodeModel , MergeFunctions , PanicStrategy , RelocModel } ;
2320- use rustc_target:: spec:: { RelroLevel , SplitDebuginfo , TargetTriple , TlsModel } ;
2259+ use rustc_target:: spec:: { RelroLevel , SanitizerSet , SplitDebuginfo , TargetTriple , TlsModel } ;
23212260 use std:: collections:: hash_map:: DefaultHasher ;
23222261 use std:: collections:: BTreeMap ;
23232262 use std:: hash:: Hash ;
0 commit comments