Skip to content

Commit 3eb7099

Browse files
committed
Revision to add a type grammar restriction
1 parent 90a997f commit 3eb7099

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

active/0000-trait-bounds-with-plus.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ Also, since kinds are now just built-in traits, it makes sense to treat a bounde
2929

3030
Instead of `:` in trait bounds for first-class traits (e.g. `&Trait:Share + Send`), we use `+` (e.g. `&Trait + Share + Send`).
3131

32+
`+` will not be permitted in `as` without parentheses. This will be done via a special *restriction* in the type grammar: the special `TYPE` production following `as` will be the same as the regular `TYPE` production, with the exception that it does not accept `+` as a binary operator.
33+
3234
# Drawbacks
3335

34-
It may be that `+` is ugly. Also, it messes with the precedence of `as`. (See Rust PR #14365 for the fallout of the latter.)
36+
* It may be that `+` is ugly.
37+
38+
* Adding a restriction complicates the type grammar more than I would prefer, but the community backlash against the previous proposal was overwhelming.
3539

3640
# Alternatives
3741

0 commit comments

Comments
 (0)