Skip to content

Commit 2daa097

Browse files
sfackleralexcrichton
authored andcommitted
Don't create reexport module if there are none
1 parent 6531d02 commit 2daa097

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc/front/test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> {
152152
for i in mod_folded.items.mut_iter() {
153153
*i = nomain(*i);
154154
}
155-
mod_folded.items.push(mk_reexport_mod(&mut self.cx, reexports));
156-
self.cx.reexports.push(self.cx.path.clone());
155+
if !reexports.is_empty() {
156+
mod_folded.items.push(mk_reexport_mod(&mut self.cx, reexports));
157+
self.cx.reexports.push(self.cx.path.clone());
158+
}
157159

158160
mod_folded
159161
}

0 commit comments

Comments
 (0)