-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
Does this differ from #20? I thought this was implied by that RFC. |
@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. |
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. |
@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). |
👍 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 |
@nikomatsakis merged in RFC PR #20 |
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.
No description provided.