@@ -1014,6 +1014,32 @@ impl OutputFilenames {
10141014 }
10151015}
10161016
1017+ bitflags:: bitflags! {
1018+ /// Scopes used to determined if it need to apply to --remap-path-prefix
1019+ pub struct RemapPathScopeComponents : u8 {
1020+ /// Apply remappings to the expansion of std::file!() macro
1021+ const MACRO = 1 << 0 ;
1022+ /// Apply remappings to printed compiler diagnostics
1023+ const DIAGNOSTICS = 1 << 1 ;
1024+ /// Apply remappings to debug information only when they are written to
1025+ /// compiled executables or libraries, but not when they are in split
1026+ /// debuginfo files
1027+ const UNSPLIT_DEBUGINFO = 1 << 2 ;
1028+ /// Apply remappings to debug information only when they are written to
1029+ /// split debug information files, but not in compiled executables or
1030+ /// libraries
1031+ const SPLIT_DEBUGINFO = 1 << 3 ;
1032+ /// Apply remappings to the paths pointing to split debug information
1033+ /// files. Does nothing when these files are not generated.
1034+ const SPLIT_DEBUGINFO_PATH = 1 << 4 ;
1035+
1036+ /// An alias for macro,unsplit-debuginfo,split-debuginfo-path. This
1037+ /// ensures all paths in compiled executables or libraries are remapped
1038+ /// but not elsewhere.
1039+ const OBJECT = Self :: MACRO . bits | Self :: UNSPLIT_DEBUGINFO . bits | Self :: SPLIT_DEBUGINFO_PATH . bits;
1040+ }
1041+ }
1042+
10171043pub fn host_triple ( ) -> & ' static str {
10181044 // Get the host triple out of the build environment. This ensures that our
10191045 // idea of the host triple is the same as for the set of libraries we've
@@ -3145,8 +3171,8 @@ pub(crate) mod dep_tracking {
31453171 BranchProtection , CFGuard , CFProtection , CrateType , DebugInfo , DebugInfoCompression ,
31463172 ErrorOutputType , InstrumentCoverage , InstrumentXRay , LdImpl , LinkerPluginLto ,
31473173 LocationDetail , LtoCli , OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes ,
3148- Passes , ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath ,
3149- SymbolManglingVersion , TraitSolver , TrimmedDefPaths ,
3174+ Passes , RemapPathScopeComponents , ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind ,
3175+ SwitchWithOptPath , SymbolManglingVersion , TraitSolver , TrimmedDefPaths ,
31503176 } ;
31513177 use crate :: lint;
31523178 use crate :: options:: WasiExecModel ;
@@ -3240,6 +3266,7 @@ pub(crate) mod dep_tracking {
32403266 StackProtector ,
32413267 SwitchWithOptPath ,
32423268 SymbolManglingVersion ,
3269+ RemapPathScopeComponents ,
32433270 SourceFileHashAlgorithm ,
32443271 TrimmedDefPaths ,
32453272 Option <LdImpl >,
0 commit comments