about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2016-03-02 22:07:03 +0100
committerAndrea Canciani <ranma42@gmail.com>2016-03-02 22:07:03 +0100
commitc984cbd9397562f58d654a639923f16569b393ba (patch)
tree4a3e8b8817c6b35d7944b00d6f18d0bef70a8bb2
parent01daf90d5dea94e99dd4b5de57028024d3445d38 (diff)
downloadrust-c984cbd9397562f58d654a639923f16569b393ba.tar.gz
rust-c984cbd9397562f58d654a639923f16569b393ba.zip
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.
-rw-r--r--src/librustc_driver/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index d0f86cfcb46..0a3ebcb4ca1 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) => {