-
Notifications
You must be signed in to change notification settings - Fork 117
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
Backfill contents since 1.0 #75
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally speaking I quite like this. Some thoughts:
- A diff of the standard library, probably just a snapshot of all release notes concatenated would be of interest to me, at least so we can see what it looks like.
- I think a status page (ideally auto-generated, but I understand that's quite hard) with the minimum rust versions would I think be good, especially for things not yet stable. This might be removed with the release.
same size as `*mut T`. It is allowed to dangle if it isn't dereferenced. | ||
|
||
If you’re building a data structure with unsafe code, `NonNull<T>` is often | ||
the right type for you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps worth mentioning NonZero types here as well? Seem similar in concept
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt like this type is more significant. They're similar, but I feel like this will get way more use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention it even if NonNull will get way more use.
|
||
``` | ||
|
||
Both `since` and `note` are optional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps make a small note that since can be in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did this
This has enabled tools like | ||
[`cargo-vendor`](https://github.com/alexcrichton/cargo-vendor) and | ||
[`cargo-local-registry`](https://github.com/alexcrichton/cargo-local-registry), | ||
which are often useful for "offline builds." They preparing the list of all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: They prepare
|
||
![Minimum Rust version: 1.16](https://img.shields.io/badge/Minimum%20Rust%20Version-1.16-brightgreen.svg) for being built-in | ||
|
||
![Minimum Rust version: various](https://img.shields.io/badge/Minimum%20Rust%20Version-various-brightgreen.svg) using [this package](https://github.com/rsolomo/cargo-check) for older versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'd maybe omit this. I'm not sure how I feel about it, but generally seems like sticking to 'core language' here would streamline things. We can maybe include a general note that some features were pulled into core from others libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm willing to do that, sure
|
||
![Minimum Rust version: various](https://img.shields.io/badge/Minimum%20Rust%20Version-various-brightgreen.svg) using [this package](https://github.com/rsolomo/cargo-check) for older versions | ||
|
||
`cargo check`is a new subcommand should speed up the development |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space after cargo check
src/rust-2018/global-allocators.md
Outdated
@@ -0,0 +1,35 @@ | |||
# Gobal allocators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Global
@@ -0,0 +1 @@ | |||
# Incremental Compilation for faster compiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like an accidental page? This is included in incremental-compilation.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other way around; that one is accidental but yes
![Minimum Rust version: 1.28](https://img.shields.io/badge/Minimum%20Rust%20Version-1.28-red.svg) for drafts of the 2018 edition | ||
|
||
We've distributed a copy of "The Rust Programming Language," affectionatly | ||
nicknamed "the book", whith every version of Rust since Rust 1.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: with
Press](https://nostarch.com/Rust). Now that the print version has shipped, | ||
the second edition is frozen. | ||
|
||
The names are a bit confusing though, becuase the "second edition" of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: because
uses it by default. | ||
|
||
As of Rust 1.23, we still defaulted to `hoedown`, but you could enable | ||
Commonmark via a flag, `--enable-commonmark`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"But we now only support the CommonMark markdown specification"
This is a ton of work, due to the way release notes are written. I'm not opposed to having this, but I really, really don't want to do it ;) |
Yeah, I think I might find some time to get a loose sketch going -- I agree the release notes don't lend themselves well to that today :) |
Tests are now passing; what do I need to do to get this merged? :) |
I'd like to give this a review before merging :) I'll give it some time today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here goes :)
|
||
Since we can interpret the data held in the union using the wrong variant and | ||
Rust can’t check this for us, that means reading or writing a union’s field | ||
is unsafe: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe take into account https://internals.rust-lang.org/t/pre-rfc-unions-drop-types-and-manuallydrop/8025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general with docs, we focus on stable Rust; I don't want to speculate on things until they're actually tied down.
@@ -0,0 +1,119 @@ | |||
# The 'try' operator, ? for easier error handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably avoid calling this the "try operator" because of try { .. }
blocks and rust-lang/rfcs#2388 (comment).
As a temporary alternative, I think "question mark operator" or "re-throw operator" works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the reason to call this the try operator try blocks?
We do call it "the question mark operator" in the book, so I'm open to change it; I thought it was changing to try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I argued on the try { .. }
RFC; rust-lang/rfcs#2388 (comment), rust-lang/rfcs#2388 (comment). However, people, rust-lang/rfcs#2388 (comment), did not seem to agree :)
@@ -0,0 +1,33 @@ | |||
# The Rust Bookshelf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it will get a new member too! This guide! 😆
@@ -1,4 +1,6 @@ | |||
# `'_`, the anonymous lifetime | |||
# '_, the anonymous lifetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm; having this in backticks highlights that this is code which is useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an oversight! will fix
@@ -0,0 +1,11 @@ | |||
# std::os has documentation for all platforms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backticks around std::os I'd say.
|
||
These are twice the size of `u64`, and so can hold more values. More specifically, | ||
|
||
* `u128`: `0` - `340,282,366,920,938,463,463,374,607,431,768,211,455` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kinda looks like an array; I'd use underscore instead as a separator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we used this text in the release blog post and people were not generally confused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose; however, 340_282_366_920_938_463_463_374_607_431_768_211_455
has the benefit of being legal Rust code :)
These are twice the size of `u64`, and so can hold more values. More specifically, | ||
|
||
* `u128`: `0` - `340,282,366,920,938,463,463,374,607,431,768,211,455` | ||
* `i128`: `−170,141,183,460,469,231,731,687,303,715,884,105,728` - `170,141,183,460,469,231,731,687,303,715,884,105,727` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
src/introduction.md
Outdated
Note that the standard library grows with each Rust release; there are *many* | ||
additions to the standard library that are not called out in this guide. Only | ||
the most absolutely major ones are, but there's tons of medium and small |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most absolutely major ones? wow, they must be real special! 😜
I think "major ones" suffices :)
|
||
## Rust 2018 | ||
|
||
- [Rust 2018](rust-2018/index.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably organize this a bit into categories after this PR; The flat list is a bit chaotic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the categories far more confusing, personally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it doesn't work well with ordering also... let's not do it for now then :)
book.toml
Outdated
@@ -1,5 +1,5 @@ | |||
[book] | |||
authors = ["The Rust Project Developers"] | |||
authors = ["steveklabnik"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha :P I guess you've earned this but I think it would be nice to keep this as is ;)
I can take one for the team :) |
|
||
![Minimum Rust version: 1.12](https://img.shields.io/badge/Minimum%20Rust%20Version-1.12-brightgreen.svg) | ||
|
||
We're always working on erorr improvements, and there are little improvements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: error
thanks @goodmanjonathan
Thanks for the reviews everyone! I'm merging this in; if we want to tweak it further, please open issues/send PRs! :D <3 |
This PR effectively re-writes the entire edition guide.
crate
visibility modifier, in-band lifetimes) have been dropped since they're also dropping from the edition probablyMost of this was taken from the various blog posts for various releases. It's not in as clean of a format as the new stuff is, but I'd like to land this first, and then look to doing that.
I'm pretty sure these tests will fail as I didn't really pay attention to code samples, but let's see!