From c984cbd9397562f58d654a639923f16569b393ba Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Wed, 2 Mar 2016 22:07:03 +0100 Subject: [PATCH] Build the same configuration when compiling and for `--print cfg` The configuration returned by `config::build_configuration` needs to be modified with `target_features::add_configuration` in order to also contain the target features. This is already done for the configuration used when compiling and when creating the documentation, but was missing in the `cfg` printing code. --- src/librustc_driver/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index d0f86cfcb46ba..0a3ebcb4ca1eb 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -565,7 +565,9 @@ impl RustcDefaultCalls { } } PrintRequest::Cfg => { - for cfg in config::build_configuration(sess) { + let mut cfg = config::build_configuration(&sess); + target_features::add_configuration(&mut cfg, &sess); + for cfg in cfg { match cfg.node { ast::MetaItemKind::Word(ref word) => println!("{}", word), ast::MetaItemKind::NameValue(ref name, ref value) => {