Skip to content

Commit 678e01a

Browse files
committed
Delay parsing of --cfg and --check-cfg options.
By storing the unparsed values in `Config` and then parsing them within `run_compiler`, the parsing functions can use the main symbol interner, and not create their own short-lived interners. This change also eliminates the need for one `EarlyErrorHandler` in rustdoc, because parsing errors can be reported by another, slightly later `EarlyErrorHandler`.
1 parent ec2b311 commit 678e01a

File tree

5 files changed

+254
-272
lines changed

5 files changed

+254
-272
lines changed

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,11 @@ fn run_compiler(
317317
return Ok(());
318318
}
319319

320-
let cfg = interface::parse_cfg(&early_error_handler, matches.opt_strs("cfg"));
321-
let check_cfg = interface::parse_check_cfg(&early_error_handler, matches.opt_strs("check-cfg"));
322320
let (odir, ofile) = make_output(&matches);
323321
let mut config = interface::Config {
324322
opts: sopts,
325-
crate_cfg: cfg,
326-
crate_check_cfg: check_cfg,
323+
crate_cfg: matches.opt_strs("cfg"),
324+
crate_check_cfg: matches.opt_strs("check-cfg"),
327325
input: Input::File(PathBuf::new()),
328326
output_file: ofile,
329327
output_dir: odir,

0 commit comments

Comments
 (0)