Rollup merge of #93915 - Urgau:rfc-3013, r=petrochenkov

Implement --check-cfg option (RFC 3013), take 2

This pull-request implement RFC 3013: Checking conditional compilation at compile time (https://github.com/rust-lang/rfcs/pull/3013) and is based on the previous attempt https://github.com/rust-lang/rust/pull/89346 by `@mwkmwkmwk` that was closed due to inactivity.

I have address all the review comments from the previous attempt and added some more tests.

cc https://github.com/rust-lang/rust/issues/82450
r? `@petrochenkov`
This commit is contained in:
Matthias Krüger 2022-02-18 23:23:10 +01:00 committed by GitHub
commit 576afec73a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 365 additions and 7 deletions

View file

@ -216,10 +216,12 @@ fn run_compiler(
}
let cfg = interface::parse_cfgspecs(matches.opt_strs("cfg"));
let check_cfg = interface::parse_check_cfg(matches.opt_strs("check-cfg"));
let (odir, ofile) = make_output(&matches);
let mut config = interface::Config {
opts: sopts,
crate_cfg: cfg,
crate_check_cfg: check_cfg,
input: Input::File(PathBuf::new()),
input_path: None,
output_file: ofile,