Uh oh!
There was an error while loading. Please reload this page.
libsyntax: Forbid type parameters in tuple indices - #19211
Conversation
aochagavia
commented
Nov 22, 2014
Some questions:
|
ghost
commented
Nov 22, 2014
@aochagavia Thanks for the PR! I think it would be nice if the error message was more targeted. For example see this PR: https://github.com/rust-lang/rust/pull/18879/files, which made an equivalent change to field expressions. |
ghost
commented
Nov 22, 2014
@aochagavia To answer your first question, yes, you're right, feel free to remove them. :) |
aochagavia
commented
Nov 22, 2014
@jakub- I have some questions regarding the error message. To get a more targeted one, there are two approaches I can think of:
|
aochagavia
commented
Nov 22, 2014
I have implemented the second approach... But it is not a perfect solution and it can be confusing as well: Do you have any ideas on how to produce a better error message? |
aochagavia
commented
Nov 23, 2014
By the way... Who would ever try to pass type parameters to tuple indexing? Do we really want to have a special case for this? It could make the error message even more confusing in most cases. The only case in which this could make sense is when a generic function is saved in a tuple. However, rust requires the type parameters to be specified when the function is stored in the tuple, not when it is called. For example: |
ghost
commented
Nov 23, 2014
@aochagavia Yeah, I think you're right! Feel free to push your current changes and I'm happy. |
This breaks code like ``` let t = (42i, 42i); ... t.0::<int> ...; ``` Change this code to not contain an unused type parameter. For example: ``` let t = (42i, 42i); ... t.0 ...; ``` Closes#19096 [breaking-change]
aochagavia
commented
Nov 23, 2014
Done! |
aochagavia
commented
Nov 23, 2014
I have added the error message ;) |
Include private items in completions for local crates
This breaks code like
Change this code to not contain an unused type parameter. For example:
Closes#19096
[breaking-change]
r? @aturon