Skip to content

Exported range_inclusive in the prelude #15258

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

Closed
wants to merge 1 commit into from

Conversation

gereeter
Copy link
Contributor

There are several examples I've noticed of people using range with an upper bound one larger than what the really want to simulate an inclusive range, the ones I remember at the moment being these two Rust by Example pages. Moreover, there has recently been some confusion about the lack of an inclusive range. This seems to be a general problem of people not realizing that range_inclusive exists. Therefore, in hopes of making it more visible and easier to use, this PR puts it the prelude. This allows the Rust by Example pages to switch to using the more readable range_inclusive without having to introduce use first.

@emberian
Copy link
Member

emberian commented Jul 2, 2014

Per the meeting, we've decided that the prelude should only be used for overwhelmingly pervasive functions, and range_inclusive just does not fall into that bucket.

As my own comment on top of that, putting something in the prelude doesn't make something more visible, just easier to use. I don't find the RbE argument particularly compelling since merely introducing a use of use isn't that difficult, if it wants to use range_inclusive.

@emberian emberian closed this Jul 2, 2014
@gereeter gereeter deleted the exported-range-inclusive branch December 17, 2015 01:29
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 17, 2023
Support getrandom syscall

And fix some simd intrinsic bugs and add a memory limit to prevent huge allocations from breaking the main process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants