Skip to content

#[allow(private_bounds)] does not work when applied directly to the "bad" item. #115475

Description

@TimNN

I tried this code:

#[allow(private_bounds)]
pub trait Foo: FooImpl {}

trait FooImpl {}

I expected to see this happen: The private_bounds lint is allowed.

Instead, this happened: The private_bounds lint still triggers.

(Applying #[allow(private_bounds)] to the entire module works).

(I'm assuming that this is unintentional, thus reporting as a "bug". If this behavior is intentional, consider this a feature request to change it).

Meta

Latest playground nightly:

1.74.0-nightly (2023-09-01 35e416303e6591a71ef6)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-visibilityArea: Visibility / privacyC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions