diff options
| author | Kevin Reid <kpreid@switchb.org> | 2025-01-05 17:06:47 -0800 |
|---|---|---|
| committer | Kevin Reid <kpreid@switchb.org> | 2025-01-05 17:13:33 -0800 |
| commit | 2a96478dd80802ca98f358ffeeea17c7a508ced7 (patch) | |
| tree | 5d73fa618bec9b2ec6beb40773d0a41d9c6a6af3 /compiler/rustc_lint/src/builtin.rs | |
| parent | b3b368a1833a26f5d48f51c45159f46e6cd01711 (diff) | |
| download | rust-2a96478dd80802ca98f358ffeeea17c7a508ced7.tar.gz rust-2a96478dd80802ca98f358ffeeea17c7a508ced7.zip | |
Mention `unnameable_types` in `unreachable_pub` documentation.
This link makes sense because someone who wishes to avoid unusable `pub` is likely, but not guaranteed, to be interested in avoiding unnameable types. Also fixed some grammar problems I noticed in the area. Fixes #116604.
Diffstat (limited to 'compiler/rustc_lint/src/builtin.rs')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 2feed5e80dc..e74fb9d92e9 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -1244,8 +1244,8 @@ impl<'tcx> LateLintPass<'tcx> for UngatedAsyncFnTrackCaller { declare_lint! { /// The `unreachable_pub` lint triggers for `pub` items not reachable from other crates - that - /// means neither directly accessible, nor reexported, nor leaked through things like return - /// types. + /// means neither directly accessible, nor reexported (with `pub use`), nor leaked through + /// things like return types (which the [`unnameable_types`] lint can detect if desired). /// /// ### Example /// @@ -1272,8 +1272,10 @@ declare_lint! { /// intent that the item is only visible within its own crate. /// /// This lint is "allow" by default because it will trigger for a large - /// amount existing Rust code, and has some false-positives. Eventually it + /// amount of existing Rust code, and has some false-positives. Eventually it /// is desired for this to become warn-by-default. + /// + /// [`unnameable_types`]: #unnameable-types pub UNREACHABLE_PUB, Allow, "`pub` items not reachable from crate root" |
