What's up with this `if`? 

Also, a module could just [contain `pub use`s](http://static.rust-lang.org/doc/master/std/prelude/index.html), or even just be a [doc comment](http://static.rust-lang.org/doc/master/rustc/middle/borrowck/doc/index.html). I.e. legitimately contain no `.items`. I think the recently added [`.inner` field](http://static.rust-lang.org/doc/master/syntax/ast/struct.Mod.html) might be what you want?

(Also, a module can be nested inside another module inside a single file, does this handle that case correctly?)