Skip to content

relaxed ?Sized bound getting implied by super trait warn #140962

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

Open
lcnr opened this issue May 13, 2025 · 0 comments
Open

relaxed ?Sized bound getting implied by super trait warn #140962

lcnr opened this issue May 13, 2025 · 0 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-type-system Area: Type system C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lcnr
Copy link
Contributor

lcnr commented May 13, 2025

the following code should lint that the ?Sized bound is unused:'

trait Proj {
    type Assoc: Clone + ?Sized;
}

fn foo<T: ?Sized + Clone>() {}

we imply Sized as it's a super trait of Clone, so the ?Sized bound does not do anything.

cc @davidtwco, related to sized_hierarchy migration stuff

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 13, 2025
@fmease fmease added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. A-type-system Area: Type system and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-type-system Area: Type system C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants