@@ -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:: {
@@ -360,6 +362,23 @@ impl LocationDetail {
360362 }
361363}
362364
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+
363382#[ derive( Clone , PartialEq , Hash , Debug ) ]
364383pub enum SwitchWithOptPath {
365384 Enabled ( Option < PathBuf > ) ,
@@ -2856,10 +2875,10 @@ pub enum WasiExecModel {
28562875pub ( crate ) mod dep_tracking {
28572876 use super :: {
28582877 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 ,
28632882 SplitDwarfKind , SwitchWithOptPath , SymbolManglingVersion , WasiExecModel ,
28642883 } ;
28652884 use crate :: lint;
@@ -2961,6 +2980,7 @@ pub(crate) mod dep_tracking {
29612980 OutputType ,
29622981 RealFileName ,
29632982 LocationDetail ,
2983+ DebugFmtDetail ,
29642984 BranchProtection ,
29652985 OomStrategy ,
29662986 LanguageIdentifier ,
0 commit comments