diff options
| author | Urgau <urgau@numericable.fr> | 2024-03-19 13:51:22 +0100 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2024-03-28 18:47:26 +0100 |
| commit | ee2898d3f1cbece34153581823fafa7f572bbff0 (patch) | |
| tree | 6adcd3647b91cae40dcd75cf670f17b1a0267170 /compiler/rustc_session/src | |
| parent | 106146fd958c3c0d3428cfc7be1f75c5bc81698f (diff) | |
| download | rust-ee2898d3f1cbece34153581823fafa7f572bbff0.tar.gz rust-ee2898d3f1cbece34153581823fafa7f572bbff0.zip | |
Make local_crate_source_file return a RealFileName
so it can be remapped (or not) by callers
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 48b00c3f5a5..65ae666f209 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -29,6 +29,7 @@ use rustc_macros::HashStable_Generic; pub use rustc_span::def_id::StableCrateId; use rustc_span::edition::Edition; use rustc_span::source_map::{FileLoader, FilePathMapping, RealFileLoader, SourceMap}; +use rustc_span::RealFileName; use rustc_span::{SourceFileHashAlgorithm, Span, Symbol}; use rustc_target::asm::InlineAsmArch; use rustc_target::spec::{CodeModel, PanicStrategy, RelocModel, RelroLevel}; @@ -250,14 +251,9 @@ impl Session { self.miri_unleashed_features.lock().push((span, feature_gate)); } - pub fn local_crate_source_file(&self) -> Option<PathBuf> { + pub fn local_crate_source_file(&self) -> Option<RealFileName> { let path = self.io.input.opt_path()?; - // FIXME: The remap path scope should probably not be hardcoded. - if self.should_prefer_remapped(RemapPathScopeComponents::DEBUGINFO) { - Some(self.opts.file_path_mapping().map_prefix(path).0.into_owned()) - } else { - Some(path.to_path_buf()) - } + Some(RealFileName::LocalPath(path.to_path_buf())) } fn check_miri_unleashed_features(&self) -> Option<ErrorGuaranteed> { |
