Implement a lint for the use of private types in exported type signatures#12595
Merged
bors merged 3 commits intorust-lang:masterfrom Feb 28, 2014
Merged
Implement a lint for the use of private types in exported type signatures#12595bors merged 3 commits intorust-lang:masterfrom
bors merged 3 commits intorust-lang:masterfrom
Conversation
Contributor
Author
|
A long delayed reimplementation of #11773. |
Member
|
This is some good work, nice job! Most of my comments are just small things here and there, I think that we'll get a lot of good use cases for this lint once landed because it's warn-by-default. Travis also has some failures you may be interested in. |
Contributor
Author
|
Added a new commit addressing everything. Will squash post-re-review. |
Member
|
r=me, nice job! |
These are types that are in exported type signatures, but are not
exported themselves, e.g.
struct Foo { ... }
pub fn bar() -> Foo { ... }
will warn about the Foo.
Such types are not listed in documentation, and cannot be named outside
the crate in which they are declared, which is very user-unfriendly.
cc rust-lang#10573
The sync submodule also has a `Condvar` type, and its reexport was shadowing the `arc` type, making it crate-private.
…laces. There's a lot of these types in the compiler libraries, and a few of the older or private stdlib ones. Some types are obviously meant to be public, others not so much.
bors
added a commit
that referenced
this pull request
Feb 28, 2014
These are types that are in exported type signatures, but are not
exported themselves, e.g.
struct Foo { ... }
pub fn bar() -> Foo { ... }
will warn about the Foo.
Such types are not listed in documentation, and cannot be named outside
the crate in which they are declared, which is very user-unfriendly.
cc #10573.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
May 2, 2024
Modify lint pass note for consistency with the book This PR: - removes the note which appears when an early lint pass is created using `cargo dev new_lint`. - adds a note that encourages contributors to use an early pass unless type information is needed if a late lint pass is created using `cargo dev new_lint`. Late pass remains the default value if no pass is specified as most lints use late pass. Closes rust-lang#12595 changelog: none
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are types that are in exported type signatures, but are not
exported themselves, e.g.
will warn about the Foo.
Such types are not listed in documentation, and cannot be named outside
the crate in which they are declared, which is very user-unfriendly.
cc #10573.