Skip to content

Commit b91c3d0

Browse files
committed
Retire Options::working_dir in favor SourceMap::working_dir
Only keep the local path to the working directory for incr comp and directory users towards `SourceMap::working_dir` instead.
1 parent 13d9b36 commit b91c3d0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ impl Default for Options {
13981398
json_unused_externs: JsonUnusedExterns::No,
13991399
json_future_incompat: false,
14001400
pretty: None,
1401-
working_dir: RealFileName::LocalPath(std::env::current_dir().unwrap()),
1401+
working_dir: std::env::current_dir().unwrap(),
14021402
color: ColorConfig::Auto,
14031403
logical_env: FxIndexMap::default(),
14041404
verbose: false,
@@ -2756,9 +2756,6 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
27562756
early_dcx.early_fatal(format!("Current directory is invalid: {e}"));
27572757
});
27582758

2759-
let file_mapping = file_path_mapping(remap_path_prefix.clone(), &unstable_opts);
2760-
let working_dir = file_mapping.to_real_filename(&working_dir);
2761-
27622759
let verbose = matches.opt_present("verbose") || unstable_opts.verbose_internals;
27632760

27642761
Options {

compiler/rustc_session/src/options.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,10 @@ top_level_options!(
491491

492492
pretty: Option<PpMode> [UNTRACKED],
493493

494-
/// The (potentially remapped) working directory
495-
working_dir: RealFileName [TRACKED],
494+
/// The local working directory
495+
#[rustc_lint_opt_deny_field_access("use `SourceMap::working_dir` instead of this field")]
496+
working_dir: PathBuf [TRACKED],
497+
496498
color: ColorConfig [UNTRACKED],
497499

498500
verbose: bool [TRACKED_NO_CRATE_HASH],

0 commit comments

Comments
 (0)