Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up`T: ?Sized` does not work in `where` clauses #20503
Comments
nrc
assigned
nrc
and unassigned
nrc
Jan 4, 2015
This comment has been minimized.
This comment has been minimized.
|
Note that we don't currently accept |
nrc
added
the
A-dst
label
Jan 4, 2015
tomprogrammer
referenced
this issue
in pfalabella/rust-ascii
Jan 4, 2015
This comment has been minimized.
This comment has been minimized.
|
@nick29581 I will poke into this. |
This comment has been minimized.
This comment has been minimized.
|
There are a few edge cases here. In particular, specifying impl<T> Foo<T> {
fn foo(&self) where T: ?Sized { ... }
}Although allowing that could potentially be useful, I suspect it would complicate the implementation and be slightly unclear anyway. Additionally, specifying |
This comment has been minimized.
This comment has been minimized.
|
What needs to be done in order to get this working? Is it just a parsing issue? |
This comment has been minimized.
This comment has been minimized.
|
Triage: still a really annoying problem. |
This comment has been minimized.
This comment has been minimized.
|
@Gankro I can fix this, probably my fault anyways. |
This comment has been minimized.
This comment has been minimized.
|
This is still a bit of a wart, and tripped me up the first time I wanted to use a |
This comment has been minimized.
This comment has been minimized.
|
I hit this issue today. |
This comment has been minimized.
This comment has been minimized.
|
@jroesch although it was a few months ago, do you remember enough context to write a very quick summary of where changes would need to be made to fix this? |
This comment has been minimized.
This comment has been minimized.
tinyplasticgreyknight
commented
Jun 12, 2016
•
|
Ran into this one today. Is it just a parsing problem? |
This comment has been minimized.
This comment has been minimized.
|
IIRC this also needs to be handled in astconv |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
hannni
commented
Jun 30, 2016
|
There at least should be some better error message telling one to put ?Sized into the definition instead of the where clause. |
This comment has been minimized.
This comment has been minimized.
matthieu-m
commented
Oct 29, 2016
•
|
This is really a papercut issue. While when I hit I generally remember "Oh yeah, this bug again" and promptly fixes it, it still would be a much smoother experience if I did not have to. Note that in the same vein, it is not supported in a trait bounds either (eg: |
This comment has been minimized.
This comment has been minimized.
|
I tried to fix this but have immediately drowned in philosophical questions.
is desugared into
and
is desugared into
A few conclusions from this:
So, how I think the fix should look:
Other stuff:
|
P1start commentedJan 4, 2015
The RFC states that the syntax should work in
whereclauses.