about summary refs log tree commit diff
path: root/src/librustc_driver
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-04-30 02:07:33 -0700
committerbors <bors@rust-lang.org>2016-04-30 02:07:33 -0700
commitb0aefff71499ac8e5f65c4a241b279e687c44c36 (patch)
treefbf61aea82a77a40de7c5406658c2ecf74a0e2f0 /src/librustc_driver
parent46504e9a9d3a57a852ff57f7530de2017a7b37ba (diff)
parent86f069d41a89122740d58d0eb8eaeb7496bb03ce (diff)
downloadrust-b0aefff71499ac8e5f65c4a241b279e687c44c36.tar.gz
rust-b0aefff71499ac8e5f65c4a241b279e687c44c36.zip
Auto merge of #32846 - jseyfried:allow_unconfigured_gated_expanded_items, r=nrc
Avoid gated feature checking unconfigured expanded items

Avoid gated feature checking unconfigured macro-expanded items (fixes #32840).
Unconfigured items that are not macro-expanded are already not gated feature checked.
r? @nrc
Diffstat (limited to 'src/librustc_driver')
-rw-r--r--src/librustc_driver/driver.rs21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index 4dd03fd2106..23e937e83e6 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -645,21 +645,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
         ret
     });
 
-    // Needs to go *after* expansion to be able to check the results
-    // of macro expansion.  This runs before #[cfg] to try to catch as
-    // much as possible (e.g. help the programmer avoid platform
-    // specific differences)
-    time(time_passes, "complete gated feature checking 1", || {
-        sess.track_errors(|| {
-            let features = syntax::feature_gate::check_crate(sess.codemap(),
-                                                             &sess.parse_sess.span_diagnostic,
-                                                             &krate,
-                                                             &attributes,
-                                                             sess.opts.unstable_features);
-            *sess.features.borrow_mut() = features;
-        })
-    })?;
-
     // JBC: make CFG processing part of expansion to avoid this problem:
 
     // strip again, in case expansion added anything with a #[cfg].
@@ -698,10 +683,8 @@ pub fn phase_2_configure_and_expand(sess: &Session,
          "checking for inline asm in case the target doesn't support it",
          || no_asm::check_crate(sess, &krate));
 
-    // One final feature gating of the true AST that gets compiled
-    // later, to make sure we've got everything (e.g. configuration
-    // can insert new attributes via `cfg_attr`)
-    time(time_passes, "complete gated feature checking 2", || {
+    // Needs to go *after* expansion to be able to check the results of macro expansion.
+    time(time_passes, "complete gated feature checking", || {
         sess.track_errors(|| {
             let features = syntax::feature_gate::check_crate(sess.codemap(),
                                                              &sess.parse_sess.span_diagnostic,