Rust: Establish conventions for macro internals

Created on 21 Feb 2015  路  4Comments  路  Source: rust-lang/rust

We should establish conventions for how to expose the implementation details of macros as parts of the public API of a crate. Currently we have two "schemes"

  • Prefix the name with __ example
  • Liberal use of #[doc(hidden)] example

It would be nice to standardize on the convention here as most of these internals "we'd really rather not expose". I personally like the double-underscore-prefix-plus-#[doc(hidden)] strategy but others may feel differently!

Nominating, this may tidy up some of our apis in std.

I-nominated

Most helpful comment

Actually, a random number of underscores chosen at compile time would probably be more foolproof.

All 4 comments

I also think double underscore + doc hidden is the way to go.

This may even call for triple underscore. It's the only way to be sure.

Actually, a random number of underscores chosen at compile time would probably be more foolproof.

+1, since other libraries can use the same conventions.

(wrong spot, @alexcrichton said should be RFC, closing)

Was this page helpful?
0 / 5 - 0 ratings