You need to introduce an explicit fn main() { ... } around your code (and put extern crate outside that function). Rustdoc automatically puts it when you don't have written it yourself, but this convenience cannot coexist with extern crate.
Ah; tests are automatically wrapped in fn main() { … } and, as the error says, you can't load a macro crate anywhere except from the root module.
To get around that, you just have to write an explicitfn main() somewhere in the doc test. Here's an example of a macro doc test (note that lines that begin with #␣ are hidden from the rendered HTML).