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

Warn about duplicated trait bounds like Send + Send #92410

Closed
kornelski opened this issue Dec 29, 2021 · 1 comment
Closed

Warn about duplicated trait bounds like Send + Send #92410

kornelski opened this issue Dec 29, 2021 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@kornelski
Copy link
Contributor

kornelski commented Dec 29, 2021

Given the following code: playground

fn _foo(_: impl Fn() + Send + Send) {}

There's no warning.

The bug is in Send specified twice, instead of one of them being a Sync. It would be nice to warn about this, e.g.:

warning: `Send` bound specified more than once

A + Send + Send has no useful purpose, but it looks very similar to a common + Send + Sync.

@kornelski kornelski added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 29, 2021
@ibraheemdev
Copy link
Member

Duplicate of #88013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints 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

2 participants