mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
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.
This commit is contained in:
@@ -1244,8 +1244,8 @@ fn check_fn(
|
||||
|
||||
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 @@ fn check_fn(
|
||||
/// 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"
|
||||
|
||||
@@ -4362,7 +4362,7 @@
|
||||
/// ### Explanation
|
||||
///
|
||||
/// It is often expected that if you can obtain an object of type `T`, then
|
||||
/// you can name the type `T` as well, this lint attempts to enforce this rule.
|
||||
/// you can name the type `T` as well; this lint attempts to enforce this rule.
|
||||
/// The recommended action is to either reexport the type properly to make it nameable,
|
||||
/// or document that users are not supposed to be able to name it for one reason or another.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user