@@ -23,7 +23,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic};
2323use rustc_span:: edition:: { DEFAULT_EDITION , EDITION_NAME_LIST , Edition , LATEST_STABLE_EDITION } ;
2424use rustc_span:: source_map:: FilePathMapping ;
2525use rustc_span:: {
26- FileName , FileNameDisplayPreference , RealFileName , SourceFileHashAlgorithm , Symbol , sym,
26+ FileName , FileNameDisplayPreference , RealFileName , SourceFileHashAlgorithm , Symbol , kw , sym,
2727} ;
2828use rustc_target:: spec:: {
2929 FramePointer , LinkSelfContainedComponents , LinkerFeatures , SplitDebuginfo , Target , TargetTuple ,
@@ -2946,7 +2946,7 @@ pub(crate) mod dep_tracking {
29462946 LtoCli , MirStripDebugInfo , NextSolverConfig , OomStrategy , OptLevel , OutFileName ,
29472947 OutputType , OutputTypes , PatchableFunctionEntry , Polonius , RemapPathScopeComponents ,
29482948 ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath ,
2949- SymbolManglingVersion , WasiExecModel ,
2949+ SymbolManglingVersion , UnsignedCharVar , WasiExecModel ,
29502950 } ;
29512951 use crate :: lint;
29522952 use crate :: utils:: NativeLib ;
@@ -3049,6 +3049,7 @@ pub(crate) mod dep_tracking {
30493049 FunctionReturn ,
30503050 WasmCAbi ,
30513051 Align ,
3052+ UnsignedCharVar ,
30523053 ) ;
30533054
30543055 impl < T1 , T2 > DepTrackingHash for ( T1 , T2 )
@@ -3323,3 +3324,31 @@ impl MirIncludeSpans {
33233324 self == MirIncludeSpans :: On
33243325 }
33253326}
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