Skip to content

Mention unnameable_types in unreachable_pub documentation. #135145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4362,7 +4362,7 @@ declare_lint! {
/// ### 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.
///
Expand Down
Loading