@@ -17,7 +17,9 @@ use rustc_errors::{ColorConfig, DiagArgValue, DiagCtxtFlags, IntoDiagArg};
17
17
use rustc_feature:: UnstableFeatures ;
18
18
use rustc_span:: edition:: { Edition , DEFAULT_EDITION , EDITION_NAME_LIST , LATEST_STABLE_EDITION } ;
19
19
use rustc_span:: source_map:: FilePathMapping ;
20
- use rustc_span:: { FileName , FileNameDisplayPreference , RealFileName , SourceFileHashAlgorithm } ;
20
+ use rustc_span:: {
21
+ sym, FileName , FileNameDisplayPreference , RealFileName , SourceFileHashAlgorithm , Symbol ,
22
+ } ;
21
23
use rustc_target:: spec:: { LinkSelfContainedComponents , LinkerFeatures } ;
22
24
use rustc_target:: spec:: { SplitDebuginfo , Target , TargetTriple } ;
23
25
use std:: collections:: btree_map:: {
@@ -360,6 +362,23 @@ impl LocationDetail {
360
362
}
361
363
}
362
364
365
+ /// Values for the `-Z debug-fmt-detail` flag.
366
+ #[ derive( Copy , Clone , PartialEq , Hash , Debug ) ]
367
+ pub enum DebugFmtDetail {
368
+ /// Derive fully-featured implementation
369
+ Full ,
370
+ /// Print only type name, without fields
371
+ Shallow ,
372
+ /// `#[derive(Debug)]` and `{:?}` are no-ops
373
+ None ,
374
+ }
375
+
376
+ impl DebugFmtDetail {
377
+ pub ( crate ) fn all ( ) -> [ Symbol ; 3 ] {
378
+ [ sym:: full, sym:: none, sym:: shallow]
379
+ }
380
+ }
381
+
363
382
#[ derive( Clone , PartialEq , Hash , Debug ) ]
364
383
pub enum SwitchWithOptPath {
365
384
Enabled ( Option < PathBuf > ) ,
@@ -2856,10 +2875,10 @@ pub enum WasiExecModel {
2856
2875
pub ( crate ) mod dep_tracking {
2857
2876
use super :: {
2858
2877
BranchProtection , CFGuard , CFProtection , CollapseMacroDebuginfo , CoverageOptions ,
2859
- CrateType , DebugInfo , DebugInfoCompression , ErrorOutputType , FunctionReturn ,
2860
- InliningThreshold , InstrumentCoverage , InstrumentXRay , LinkerPluginLto , LocationDetail ,
2861
- LtoCli , NextSolverConfig , OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes ,
2862
- Polonius , RemapPathScopeComponents , ResolveDocLinks , SourceFileHashAlgorithm ,
2878
+ CrateType , DebugFmtDetail , DebugInfo , DebugInfoCompression , ErrorOutputType ,
2879
+ FunctionReturn , InliningThreshold , InstrumentCoverage , InstrumentXRay , LinkerPluginLto ,
2880
+ LocationDetail , LtoCli , NextSolverConfig , OomStrategy , OptLevel , OutFileName , OutputType ,
2881
+ OutputTypes , Polonius , RemapPathScopeComponents , ResolveDocLinks , SourceFileHashAlgorithm ,
2863
2882
SplitDwarfKind , SwitchWithOptPath , SymbolManglingVersion , WasiExecModel ,
2864
2883
} ;
2865
2884
use crate :: lint;
@@ -2961,6 +2980,7 @@ pub(crate) mod dep_tracking {
2961
2980
OutputType ,
2962
2981
RealFileName ,
2963
2982
LocationDetail ,
2983
+ DebugFmtDetail ,
2964
2984
BranchProtection ,
2965
2985
OomStrategy ,
2966
2986
LanguageIdentifier ,
0 commit comments