-
Notifications
You must be signed in to change notification settings - Fork 13.4k
TRPL: example from stable book with step_by does not compile with stable 1.0 compiler #25499
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
I also cannot use the feature directive:
|
Using "#![feature(step_by)]" should work if you switch to the nightly channel. For example, I got it to work using: |
Yeah, all unstable features are disabled in the stable and beta builds. You can read more of the rationale for this here: http://blog.rust-lang.org/2014/10/30/Stability.html It is potentially problematic that |
As a potential user I expect that I can use the examples in the stable docs with the stable compiler. If I cannot then I expect to see a note describing why not. |
The book shouldn't use unstable things except in the nightly section at the end, for sure. |
@steveklabnik: In terms of making this change, would it involve manually patching the 1.0 source? In general do we have a way to update the docs for a release after the release has been made? |
No, it's just a bug to be fixed on master and will go out with the next release its part of. |
In http://doc.rust-lang.org/stable/book/iterators.html there the third code from the bottom reads:
Trying to compile this gives:
In http://doc.rust-lang.org/1.0.0/core/ops/struct.Range.html#method.step_by
one can see "Unstable: recent addition"
I did not find a way to compile the example.
Adding '#[unstable]' as first line in the source does not help but gives:
rustc --version --verbose
rustc 1.0.0 (a59de37 2015-05-13) (built 2015-05-14)
binary: rustc
commit-hash: a59de37
commit-date: 2015-05-13
build-date: 2015-05-14
host: x86_64-unknown-linux-gnu
release: 1.0.0
The text was updated successfully, but these errors were encountered: