rust-lang / rust-lang/fls

where clause is permitted to be empty

Open
#533 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-generics C-bug
Dominant language
reStructuredText
Stars
497
Forks
41
Avg merge
3h 52m
Merged PRs (30d)
4

Description

WhereClause is permitted to be empty (i.e. a bare where) in baseline Rust. The following statements all compile:

struct Struct where {
}
enum Enum where {
}
type TypeAlias where = Struct;
trait Trait where {
}
fn function() where {
}
impl Struct where {
}
impl Trait for Struct where {
}

In the Ferrocene spec, 12.2 "Where Clauses" specifies that a WhereClause contains a WhereClausePredicateList which must be a non-empty list. However, Rust permits an empty list (which has the same effect as if where was not specified at all). The specification should probably be amended to reflect the actual grammar.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read section 12.2, “Where Clauses,” and compare its requirement for a non-empty WhereClausePredicateList with the Rust examples in the issue. Amend the specification grammar to permit an empty predicate list, while preserving the existing behavior for non-empty clauses; the examples should then be consistent with the specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.