{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreifd6vnisze2k6bqojt33l3wtb46ob5sngq5l6zn5nzjpxg7t7rukq",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3miw7gkjbant2"
  },
  "path": "/t/pre-rfc-bulk-visibility-syntax/24136#post_7",
  "publishedAt": "2026-04-06T20:08:57.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "reasoning footprint",
    "not explicit"
  ],
  "textContent": "> This is a place where Aaron's reasoning footprint could help you analyze it, or some of the words in boat's not explicit post.\n\nThank you, I wish these were a part of the official guidelines. They're a lot more concrete and helpful to reason through whether if my proposal is warranted.\n\n> I would also suggest poking at exactly what you're trying to solve here. For example, is it as annoying if it's just `pub` rather than `pub(in ...)`? To me it feels not at all worth it for `pub { ... }`, for example. So there are alternatives like \"what if we just have `internal fn` or something\" to avoid the `pub(crate)`.\n\nThough not clear in the original post (that's my bad, I'm obviously new to proposing features), in my eyes this solves more than just poor aesthetics and unnecessary typing, it can also communicate relation (e.g. \"these are the exports of this module\") and actively help with refactoring adjacent visibility. Consider the following example:\n\n\n    mod a;\n    mod b;\n    mod c;\n    mod d;\n\n\nAssuming these modules are related in some way (perhaps they are different kinds of AST nodes), if you wanted to publicize all of them you'd have to insert `pub` in front of each of them, but what if you change your mind and now have to make them `pub(crate)`? The syntax _punishes_ you for iteration; by making your repeat yourself & forcing you to be explicit, for absolutely no underlying reason. Which is (from what I understand) against Rust's core philosophy, syntactic punishment is only appropriate in places where a practice should be actively discouraged. Obviously in this case it isn't intentional punishment, but punishment regardless.\n\nYou could argue that the punishment is actually warranted here because if it was easier to make everything in a module public, then people would abuse that. Which is a good point, however there is a real asymmetry in syntactic punishment involving `pub`. Because controlled publicity is even _more_ punishing than full publicity, you could argue that it's grounds for people to use `pub` inappropriately in places where `pub(crate)` or similar would be more appropriate.\n\nThis happens _[to me]_ quite a bit, especially while working on a complex crate that's also evolving. This syntax would definitely remedy the situation.\n\nOf course you could argue that's a \"you situation\" and an extension of \"I don't like typing\", which is fair enough I suppose.\n\nIt is also worth considering the idea about allowing this syntax in `struct`/`impl` bodies as well, I think that could add more potential utility to the proposal.\n\n> Remember that `extern \"C\" fn foo() { ... }` and `extern \"C\" { fn foo(); }` are completely different. It's not that one is the bulk and the other isn't.\n\nThat's completely on me, I never used the `extern \"C\" fn foo() { ... }` syntax considering exporting symbols _from rust_ is quite rare, so I wrongly deduced that it was the singular form of an `extern \"C\" { ... }` block. That's poor research on my part, my apologies. Though the `use` example still applies here.",
  "title": "[Pre-RFC] Bulk visibility syntax"
}