Skip to content
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

Remove obsolete private_in_public lint in nightly. #113

Merged

Conversation

thenorili
Copy link
Contributor

RFC 2145 is on nightly now, deprecating the public_in_private lint. https://rust-lang.github.io/rfcs/2145-type-privacy.html

public_in_private has been superceded by three new lints. The first two are warn-by-default and the third is allow-by-default. See the excerpt below for some details.

This change skips this lint in nightly in favor of the new warn-by-default lints.

This change revealed a bug in the 'nightly_features' config option for color-spantrace -- it doesn't exist! The lint it was guarding was never turned on. This adds a minimal build script to check for nightly to color-spantrace. Its functionality is tested in the eyre crate, which seems sufficient to me.

The proof this works is that it builds without the warning in nightly : )

After this change there are only two more build warnings for eyre and color-spantrace, the future-incompat dependency warning and the more serious filename collision.

Lint private_interfaces is reported when a type with visibility x is used in primary interface of an item with effective visibility y and x < y. This lint is warn-by-default.
Lint private_bounds is reported when a type or trait with visibility
x is used in secondary interface of an item with effective
visibility y and x < y. This lint is warn-by-default.

Lint unnameable_types is reported when effective visibility of a
type is larger than module in which it can be named, either
directly, or through reexports, or through trivial type aliases
(type X = Y;, no generics on both sides). This lint is
allow-by-default.

Compatibility lint private_in_public is never reported and removed.

@thenorili
Copy link
Contributor Author

Missed rust-fmt! I have blocked myself from making the mistake again : )

vscode settings.json

    "[rust]": {
        "editor.defaultFormatter": "rust-lang.rust-analyzer",
        "editor.formatOnSave": true,
    },

eyre/src/lib.rs Outdated Show resolved Hide resolved
RFC 2145 is in beta now, deprecating the public_in_private lint.
https://rust-lang.github.io/rfcs/2145-type-privacy.html

public_in_private has been superceded by three new lints. The first two
are warn-by-default and the third is allow-by-default. See the excerpt
below for some details.

This change skips this lint in nightly and beta in favor of the new
warn-by-default lints.

This change revealed a bug in the toolchain config option for
color-spantrace -- it doesn't exist! The lint it was guarding was never
turned on. This adds a minimal build script to check for toolchain to
color-spantrace. Its functionality is tested in the eyre crate, which
seems sufficient to me.

After this change there are only two more build warnings for eyre and
color-spantrace, the future-incompat dependency warning and the more
serious filename collision.

<quote>
    Lint private_interfaces is reported when a type with visibility x is
    used in primary interface of an item with effective visibility y and
    x < y. This lint is warn-by-default.

    Lint private_bounds is reported when a type or trait with visibility
    x is used in secondary interface of an item with effective
    visibility y and x < y. This lint is warn-by-default.

    Lint unnameable_types is reported when effective visibility of a
    type is larger than module in which it can be named, either
    directly, or through reexports, or through trivial type aliases
    (type X = Y;, no generics on both sides). This lint is
    allow-by-default.

    Compatibility lint private_in_public is never reported and removed.
</quote>
@thenorili thenorili force-pushed the deprecate-private_in_public-in-nightly branch from a8df72a to 4a39daf Compare November 13, 2023 05:05
Copy link
Collaborator

@yaahc yaahc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me ^_^

@yaahc yaahc merged commit 75511af into eyre-rs:master Nov 17, 2023
29 checks passed
@thenorili thenorili deleted the deprecate-private_in_public-in-nightly branch November 18, 2023 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants