-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Can't use where
clauses with tuple structs
#17904
Comments
struct Foo<T> where T: Copy, (T); seems to work. However, the syntax is awful, and requires a comma for disambiguation. |
struct Foo<T> where T: Copy, (T); //~ error: unexpected token in `where` clause @P1start As of today nightly, that doesn't work anymore. @nikomatsakis It seems that where clauses don't work with tuple structs anymore. Any plans to support them in the future? |
@nikomatsakis is this the desired syntax? I'm assuming it was chosen in order to do some kind of parsing disambiguation. I am willing to submit a small patch for this, just want clarification on the syntax. |
hmm afaik they should work, and I would expect the syntax to be |
I will track this one down and follow up with a PR. |
You can get the current syntax to compile if the generic type bound uses the struct Foo<T> where T: Fn() (T); Nominating, since we won't be able to move the where clause to after the tuple after 1.0 without breakage. |
Fixes rust-lang#17904. All the cases that I believe we should support are detailed in the test case, let me know if there is there is any more desired behavior. cc @japaric. r? @nikomatsakis or whoever is appropriate.
Fixes rust-lang#17904. All the cases that I believe we should support are detailed in the test case, let me know if there is there is any more desired behavior. cc @japaric. r? @nikomatsakis or whoever is appropriate.
STR
Version
(PR 17669 on top of b08ecf7)
The text was updated successfully, but these errors were encountered: