-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tuples should be fundamental #31682
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
Comments
That's the annoying future compatibility rules. Tuples are currently not |
Hmm. It does seem like tuples ought to be considered fundamental. I'd not be opposed to an RFC on this topic. |
In case that’s a hint for me to write an RFC: I don’t feel I can since I don’t understand the finer details of coherence rules or what fundamental means in this context, only the end result of “I can’t write this seemingly-reasonable code”. |
It wasn't really a hint to YOU Simon ;) Probably this doesn't merit a full RFC actually; an amendment to the existing one might suffice. On Tue, Feb 16, 2016 at 09:07:54PM -0800, Simon Sapin wrote:
|
Are there any recommended work-arounds for this? I just ran into the same problem (entertainingly, with pretty must the exact code posted in the test case). Has there been any progress on an RFC addition? |
I've also run into this issue. @jashephe My workaround was just to make my own tuple-like struct and implement the trait for that struct instead. impl ToSocketAddrs for Pair<Host, u16> { ... My quick search did not find any RFC for making tuples |
I think treating tuples as fundamental makes sense. We should probably write up an RFC for it. |
Well, then, I'll attempt to write it! I'm eager to make my first contribution (however small) to Rust. |
I'm told that @nikomatsakis is the person to speak to why tuples aren't fundamental. @arielb1 says that they aren't sure why this is the case. |
Nominating for lang team. I believe we should close this issue in favor of one on the rfcs repo, though it seems unlikely that unless someone motivated steps up to write the RFC it'll happen. Perhaps we could mentor someone? I recall @nrc had a mentoring repo for RFCs... |
Closing. If someone wants to pursue this, please follow the RFC process here https://github.com/rust-lang/rfcs#before-creating-an-rfc. There's no real point in the lang team discussing this until that happens. |
This is actually included as a part of my variadic generics RFC. It might be useful to break it out into a smaller proposal, though. |
Test case:
Output with rustc 1.8.0-nightly (fae5162 2016-02-13):
But the impl does define a type defined in this crate,
Host
.Is this impl fundamentally problematic, or could coherence rules be extended for tuples?
The text was updated successfully, but these errors were encountered: