@@ -17,7 +17,9 @@ use rustc_errors::{ColorConfig, DiagArgValue, DiagCtxtFlags, IntoDiagArg};
1717use rustc_feature:: UnstableFeatures ;
1818use rustc_span:: edition:: { Edition , DEFAULT_EDITION , EDITION_NAME_LIST , LATEST_STABLE_EDITION } ;
1919use 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+ } ;
2123use rustc_target:: spec:: { LinkSelfContainedComponents , LinkerFeatures } ;
2224use rustc_target:: spec:: { SplitDebuginfo , Target , TargetTriple } ;
2325use std:: collections:: btree_map:: {
@@ -362,6 +364,23 @@ impl LocationDetail {
362364 }
363365}
364366
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+
365384#[ derive( Clone , PartialEq , Hash , Debug ) ]
366385pub enum SwitchWithOptPath {
367386 Enabled ( Option < PathBuf > ) ,
@@ -2868,10 +2887,10 @@ pub enum WasiExecModel {
28682887pub ( crate ) mod dep_tracking {
28692888 use super :: {
28702889 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 ,
28752894 SplitDwarfKind , SwitchWithOptPath , SymbolManglingVersion , WasiExecModel ,
28762895 } ;
28772896 use crate :: lint;
@@ -2973,6 +2992,7 @@ pub(crate) mod dep_tracking {
29732992 OutputType ,
29742993 RealFileName ,
29752994 LocationDetail ,
2995+ DebugFmtDetail ,
29762996 BranchProtection ,
29772997 OomStrategy ,
29782998 LanguageIdentifier ,
0 commit comments