Skip to content

Add a lint to warn about &(dyn … + Send) #110937

Open
@m-ou-se

Description

@m-ou-se

Adding + Send to a &dyn is a useless restriction. E.g. &(dyn Any + Send) implicitly converts to &dyn Any, but not the other way around, even though it'd be sound to just transmute it in both directions, since the Send isn't of any use for (shared) references.

It'd be nice if we suggest removing the + Send for &(dyn … + Send).

See #110799

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.E-help-wantedCall for participation: Help is requested to fix this issue.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