Skip to content

Commit

Permalink
Add notes about the old #[macro_registrar]
Browse files Browse the repository at this point in the history
  • Loading branch information
Keegan McAllister committed Jun 3, 2014
1 parent fbadba8 commit 21aacba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions active/0000-plugin-registrar.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,18 @@ More moving parts.

`Registry` is provided by `librustc`, because it will have methods for registering lints and other `librustc` things. This means that syntax extensions must link `librustc`, when before they only needed `libsyntax` (but could link `librustc` anyway if desired). This was discussed [on the RFC PR](https://github.com/rust-lang/rfcs/pull/86) and [the Rust PR](https://github.com/mozilla/rust/pull/14554) and [on IRC](https://botbot.me/mozilla/rust-internals/2014-05-22/?msg=15075433&page=5).

`#![feature(macro_registrar)]` becomes unknown, contradicting a comment in `feature_gate.rs`:

> This list can never shrink, it may only be expanded (in order to prevent old programs from failing to compile)
Since when do we ensure that old programs will compile? ;) The `#[macro_registrar]` attribute wouldn't work anyway.

# Alternatives

We could add `#[lint_registrar]` etc. alongside `#[macro_registrar]`. This seems like it will produce more duplicated effort all around. It doesn't provide convenience methods, and it won't support API evolution as well.

We could support the old `#[macro_registrar]` by injecting an adapter shim. This is significant extra work to support a feature with no stability guarantee.

# Unresolved questions

Naming bikeshed.
Expand Down

0 comments on commit 21aacba

Please sign in to comment.