Skip to content

Cleanup: Use #![feature(associated_type_bounds)] where applicable #61738

Closed
@Centril

Description

@Centril

We can now write bounds of form:

T: MyTrait<AssociatedType: OtherTrait>,

When you find bounds of form:

T: MyTrait,
T::AssociatedType: OtherTrait,
// or, but less commonly:
<T as MyTrait>::AssociatedType: OtherTrait,

You can rewrite them to the first form (but you'll need to add the feature gate...).

One regex you can try is: ::\w+: \w+ (doesn't cover lifetimes).

This is relevant both for the standard library and throughout the compiler.
Clippy may also want to do this and possibly also add an experimental lint? cc @oli-obk

cc #52662

This issue has been assigned to @iluuu1994 via this comment.

Metadata

Metadata

Assignees

Labels

C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.F-associated_type_bounds`#![feature(associated_type_bounds)]`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