about summary refs log tree commit diff
path: root/src/librustc_driver
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-02-17 15:54:25 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-02-17 17:33:20 +0530
commit020e4e4ad981ce0518bd8e3464ac592717c41143 (patch)
treefeca45da907af4dedc7aa930a8292a5fdf78073a /src/librustc_driver
parent0e892283612ea21ce5aeb3be930296623facab36 (diff)
parentdc0797c0c99e7079170d0e09f82fc6f66b721932 (diff)
downloadrust-020e4e4ad981ce0518bd8e3464ac592717c41143.tar.gz
rust-020e4e4ad981ce0518bd8e3464ac592717c41143.zip
Rollup merge of #22383 - pnkfelix:pass-features-along-during-expansion, r=huonw
 Pass features along during expansion

Use the set of passed features to detect uses of feature-gated macros without the corresponding feature enabled.

Fix #22234.

----

Also, the framework this add (passing along a reference to the features in the expansion context) is a necessary precursor for landing a properly feature-gated desugaring-based overloaded-`box` and placement-`in` (#22181).

----

This is fixing a bug, but since there might be code out there that is unknowingly taking advantage of that bug, I feel obligated to mark this as a:

[breaking-change]
Diffstat (limited to 'src/librustc_driver')
-rw-r--r--src/librustc_driver/driver.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index eb1dba7159c..728ff647599 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -471,9 +471,10 @@ pub fn phase_2_configure_and_expand(sess: &Session,
                 new_path.extend(env::split_paths(&_old_path));
                 env::set_var("PATH", &env::join_paths(new_path.iter()).unwrap());
             }
+            let features = sess.features.borrow();
             let cfg = syntax::ext::expand::ExpansionConfig {
                 crate_name: crate_name.to_string(),
-                enable_quotes: sess.features.borrow().quote,
+                features: Some(&features),
                 recursion_limit: sess.recursion_limit.get(),
             };
             let ret = syntax::ext::expand::expand_crate(&sess.parse_sess,