Skip to content

Higher ranked trivial bounds are not checked #50935

Open
@leoyvens

Description

@leoyvens

As can be seen in the example:

trait Trait {}
// Checked
fn foo() where i32 : Trait {}
// Not checked.
fn bar() where for<'a> fn(&'a ()) : Trait {}

In light of #2056 this will become just a lint, but still we should lint in both cases rather than just the first. This would be fixed by having well-formedness not ignore higher-ranked predicates. See #50815 for an attempted fix which resulted in too many regressions, probably for other bugs in handling higher-ranked stuff. We can try revisiting this after more chalkification.

Metadata

Metadata

Labels

A-higher-rankedArea: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)A-trait-systemArea: Trait systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.S-types-trackedStatus: Being actively tracked by the types teamT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types 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