Skip to content

Commit 5eb775e

Browse files
committed
Remove redundant gated feature checking pass
1 parent 417a6df commit 5eb775e

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/librustc_driver/driver.rs

+2-17
Original file line numberDiff line numberDiff line change
@@ -647,19 +647,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
647647
krate
648648
})?;
649649

650-
// Needs to go *after* expansion to be able to check the results
651-
// of macro expansion.
652-
time(time_passes, "complete gated feature checking 1", || {
653-
sess.track_errors(|| {
654-
let features = syntax::feature_gate::check_crate(sess.codemap(),
655-
&sess.parse_sess.span_diagnostic,
656-
&krate,
657-
&attributes,
658-
sess.opts.unstable_features);
659-
*sess.features.borrow_mut() = features;
660-
})
661-
})?;
662-
663650
krate = time(time_passes, "maybe building test harness", || {
664651
syntax::test::modify_for_testing(&sess.parse_sess, &sess.opts.cfg, krate, sess.diagnostic())
665652
});
@@ -676,10 +663,8 @@ pub fn phase_2_configure_and_expand(sess: &Session,
676663
"checking for inline asm in case the target doesn't support it",
677664
|| no_asm::check_crate(sess, &krate));
678665

679-
// One final feature gating of the true AST that gets compiled
680-
// later, to make sure we've got everything (e.g. configuration
681-
// can insert new attributes via `cfg_attr`)
682-
time(time_passes, "complete gated feature checking 2", || {
666+
// Needs to go *after* expansion to be able to check the results of macro expansion.
667+
time(time_passes, "complete gated feature checking", || {
683668
sess.track_errors(|| {
684669
let features = syntax::feature_gate::check_crate(sess.codemap(),
685670
&sess.parse_sess.span_diagnostic,

0 commit comments

Comments
 (0)