@@ -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:: {
@@ -362,6 +364,23 @@ impl LocationDetail {
362
364
}
363
365
}
364
366
367
+ /// Values for the `-Z debug-fmt-detail` flag.
368
+ #[ derive( Copy , Clone , PartialEq , Hash , Debug ) ]
369
+ pub enum DebugFmtDetail {
370
+ /// Derive fully-featured implementation
371
+ Full ,
372
+ /// Print only type name, without fields
373
+ Shallow ,
374
+ /// `#[derive(Debug)]` and `{:?}` are no-ops
375
+ None ,
376
+ }
377
+
378
+ impl DebugFmtDetail {
379
+ pub ( crate ) fn all ( ) -> [ Symbol ; 3 ] {
380
+ [ sym:: full, sym:: none, sym:: shallow]
381
+ }
382
+ }
383
+
365
384
#[ derive( Clone , PartialEq , Hash , Debug ) ]
366
385
pub enum SwitchWithOptPath {
367
386
Enabled ( Option < PathBuf > ) ,
@@ -2868,10 +2887,10 @@ pub enum WasiExecModel {
2868
2887
pub ( crate ) mod dep_tracking {
2869
2888
use super :: {
2870
2889
BranchProtection , CFGuard , CFProtection , CollapseMacroDebuginfo , CoverageOptions ,
2871
- CrateType , DebugInfo , DebugInfoCompression , ErrorOutputType , FunctionReturn ,
2872
- InliningThreshold , InstrumentCoverage , InstrumentXRay , LinkerPluginLto , LocationDetail ,
2873
- LtoCli , NextSolverConfig , OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes ,
2874
- Polonius , RemapPathScopeComponents , ResolveDocLinks , SourceFileHashAlgorithm ,
2890
+ CrateType , DebugFmtDetail , DebugInfo , DebugInfoCompression , ErrorOutputType ,
2891
+ FunctionReturn , InliningThreshold , InstrumentCoverage , InstrumentXRay , LinkerPluginLto ,
2892
+ LocationDetail , LtoCli , NextSolverConfig , OomStrategy , OptLevel , OutFileName , OutputType ,
2893
+ OutputTypes , Polonius , RemapPathScopeComponents , ResolveDocLinks , SourceFileHashAlgorithm ,
2875
2894
SplitDwarfKind , SwitchWithOptPath , SymbolManglingVersion , WasiExecModel ,
2876
2895
} ;
2877
2896
use crate :: lint;
@@ -2973,6 +2992,7 @@ pub(crate) mod dep_tracking {
2973
2992
OutputType ,
2974
2993
RealFileName ,
2975
2994
LocationDetail ,
2995
+ DebugFmtDetail ,
2976
2996
BranchProtection ,
2977
2997
OomStrategy ,
2978
2998
LanguageIdentifier ,
0 commit comments