Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Check actual type parameters against their bounds #34

Merged
merged 2 commits into from
Apr 23, 2014

Conversation

nrc
Copy link
Member

@nrc nrc commented Apr 5, 2014

No description provided.

@alexcrichton
Copy link
Member

Does this differ from #20? I thought this was implied by that RFC.

@nrc
Copy link
Member Author

nrc commented Apr 5, 2014

@alexcrichton No #20 is a prerequisite to this one, it suggests adding bounds to structs and enums. This RFC suggests checking against the given bounds wherever they are given - whether that is structs, enums, or traits. In the taxonomy of comment #20 (comment), that RFC is part 1, this RFC is part 2.

@lilyball
Copy link
Contributor

lilyball commented Apr 5, 2014

Why would #20 be implemented without actually checking the bounds? Having bounds that are declared but never checked seems actually worse than having no bounds at all.

@nrc
Copy link
Member Author

nrc commented Apr 5, 2014

@kballard I do mean to check bounds for structs in that RFC when structs are instantiated at the very least, and also in impls. One problem with the current situation is I can't even say where we need to check them . With this RFC I say we must check them everywhere (and also for traits).

@flaper87
Copy link

👍

I think this is an important change and it deserves its own RFC. We currently have a quite weak bound checking in terms of the things we want to check. I believe extending bound checking to the things bounds to be specified is important and will make the language more consistent.

Both RFCs 0003 and the proposal #20 will require bound checking and we need to consolidate where this will be done and extend the rules.

@nrc
Copy link
Member Author

nrc commented Apr 23, 2014

@nikomatsakis merged in RFC PR #20

@nikomatsakis nikomatsakis merged commit 7be7eb0 into rust-lang:master Apr 23, 2014
@lexspoon lexspoon mentioned this pull request Jul 3, 2014
pnkfelix added a commit to pnkfelix/rfcs that referenced this pull request Oct 8, 2014
In particular:

* The RFC associated with rust-lang#127 should have had a link to rust-lang#19 as well
  (and has been assigned RFC rust-lang#19); it also was revised to match the
  markdown href style of other RFCs.

* RFC rust-lang#34 needed its header entries filled in,

* RFC rust-lang#123 had a typo in its header, and

* RC rust-lang#155 was revised to match the markdown href style of other RFCs.
withoutboats pushed a commit to withoutboats/rfcs that referenced this pull request Jan 15, 2017
@Centril Centril added A-traits Trait system related proposals & ideas A-typesystem Type system related proposals & ideas labels Nov 23, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-traits Trait system related proposals & ideas A-typesystem Type system related proposals & ideas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants