Skip to content

Commit ea5c413

Browse files
committed
Perform expansion before stripping/building a test harness.
This allows macros to create tests and benchmarks.
1 parent 5a65f51 commit ea5c413

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/driver/driver.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,16 @@ pub fn compile_rest(sess: Session,
183183
*sess.building_library = session::building_library(
184184
sess.opts.crate_type, crate, sess.opts.test);
185185

186+
crate = time(time_passes, ~"expansion", ||
187+
syntax::ext::expand::expand_crate(sess.parse_sess, copy cfg,
188+
crate));
189+
186190
crate = time(time_passes, ~"configuration", ||
187191
front::config::strip_unconfigured_items(crate));
188192

189193
crate = time(time_passes, ~"maybe building test harness", ||
190194
front::test::modify_for_testing(sess, crate));
191195

192-
crate = time(time_passes, ~"expansion", ||
193-
syntax::ext::expand::expand_crate(sess.parse_sess, copy cfg,
194-
crate));
195-
196196
if upto == cu_expand { return (crate, None); }
197197

198198
crate = time(time_passes, ~"intrinsic injection", ||

0 commit comments

Comments
 (0)