Skip to content

Commit 21aacba

Browse files
author
Keegan McAllister
committed
Add notes about the old #[macro_registrar]
1 parent fbadba8 commit 21aacba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

active/0000-plugin-registrar.md

+8
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,18 @@ More moving parts.
7474

7575
`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).
7676

77+
`#![feature(macro_registrar)]` becomes unknown, contradicting a comment in `feature_gate.rs`:
78+
79+
> This list can never shrink, it may only be expanded (in order to prevent old programs from failing to compile)
80+
81+
Since when do we ensure that old programs will compile? ;) The `#[macro_registrar]` attribute wouldn't work anyway.
82+
7783
# Alternatives
7884

7985
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.
8086

87+
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.
88+
8189
# Unresolved questions
8290

8391
Naming bikeshed.

0 commit comments

Comments
 (0)