Good question. Whatever library provides it will need to be linked by all syntax extensions. If it stays in `libsyntax`, that seems odd for a lint registry, although lints presumably need to use the AST and therefore need to link against `libsyntax` anyway.

Of course, supporting lints also poses a problem. I haven't really looked at them before, but they apparently use a `Context` type defined in `librustc`. Since `librustc` links against `libsyntax`, `libsyntax` can't very well link against `librustc`. Extracting the registry to a separate library doesn't help, because it would have to link against `librustc` to get the same `Context` type, and `librustc` would have to link against it.

I see a few options here:

1. Go with the alternative of a separate registrar per type. That's kind of crappy though.
2. Extract `rustc::middle::lint::Context` out of `librustc` and put it in `libsyntax` or a brand new library. This probably isn't doable, it has a few other `librustc` types embedded in it.
3. Define the registry in a separate library and use trait magic to make it generic. Both `librustc` and `libsyntax` can then provide trait implementations for lints and syntax extensions.

The third is the most complicated, but allows this little library to stand on its own, and for syntax extensions to only link against either `libsyntax` or `librustc` as needed.