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

where clause is permitted to be empty #533

Open
nneonneo opened this issue Nov 13, 2024 · 0 comments
Open

where clause is permitted to be empty #533

nneonneo opened this issue Nov 13, 2024 · 0 comments

Comments

@nneonneo
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant