@@ -23,7 +23,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic};
23
23
use rustc_span:: edition:: { DEFAULT_EDITION , EDITION_NAME_LIST , Edition , LATEST_STABLE_EDITION } ;
24
24
use rustc_span:: source_map:: FilePathMapping ;
25
25
use rustc_span:: {
26
- FileName , FileNameDisplayPreference , RealFileName , SourceFileHashAlgorithm , Symbol , sym,
26
+ FileName , FileNameDisplayPreference , RealFileName , SourceFileHashAlgorithm , Symbol , kw , sym,
27
27
} ;
28
28
use rustc_target:: spec:: {
29
29
FramePointer , LinkSelfContainedComponents , LinkerFeatures , SplitDebuginfo , Target , TargetTuple ,
@@ -2946,7 +2946,7 @@ pub(crate) mod dep_tracking {
2946
2946
LtoCli , MirStripDebugInfo , NextSolverConfig , OomStrategy , OptLevel , OutFileName ,
2947
2947
OutputType , OutputTypes , PatchableFunctionEntry , Polonius , RemapPathScopeComponents ,
2948
2948
ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath ,
2949
- SymbolManglingVersion , WasiExecModel ,
2949
+ SymbolManglingVersion , UnsignedCharVar , WasiExecModel ,
2950
2950
} ;
2951
2951
use crate :: lint;
2952
2952
use crate :: utils:: NativeLib ;
@@ -3049,6 +3049,7 @@ pub(crate) mod dep_tracking {
3049
3049
FunctionReturn ,
3050
3050
WasmCAbi ,
3051
3051
Align ,
3052
+ UnsignedCharVar ,
3052
3053
) ;
3053
3054
3054
3055
impl < T1 , T2 > DepTrackingHash for ( T1 , T2 )
@@ -3323,3 +3324,31 @@ impl MirIncludeSpans {
3323
3324
self == MirIncludeSpans :: On
3324
3325
}
3325
3326
}
3327
+
3328
+ /// The different settings that the `-Zunsigned-char` flag can have.
3329
+ #[ derive( Clone , Copy , PartialEq , Hash , Debug , Default ) ]
3330
+ pub enum UnsignedCharVar {
3331
+ /// Use default signed/unsigned c_char according to target configuration
3332
+ #[ default]
3333
+ Default ,
3334
+
3335
+ /// Set c_char to signed i8
3336
+ Signed ,
3337
+
3338
+ /// Set c_char to unsigned u8
3339
+ Unsigned ,
3340
+ }
3341
+
3342
+ impl UnsignedCharVar {
3343
+ pub const fn desc_symbol ( & self ) -> Symbol {
3344
+ match * self {
3345
+ Self :: Default => kw:: Default ,
3346
+ Self :: Signed => sym:: signed,
3347
+ Self :: Unsigned => sym:: unsigned,
3348
+ }
3349
+ }
3350
+
3351
+ pub const fn all ( ) -> [ Symbol ; 3 ] {
3352
+ [ Self :: Unsigned . desc_symbol ( ) , Self :: Signed . desc_symbol ( ) , Self :: Default . desc_symbol ( ) ]
3353
+ }
3354
+ }
0 commit comments