Conversation
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
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! No newline at end of file |
There was a problem hiding this comment.
Perhaps worth mentioning NonZero types here as well? Seem similar in concept
There was a problem hiding this comment.
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.
I would mention it even if NonNull will get way more use.
|
|
||
| ``` | ||
|
|
||
| Both `since` and `note` are optional. No newline at end of file |
There was a problem hiding this comment.
Perhaps make a small note that since can be in the future?
| 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 |
|
|
||
|  for being built-in | ||
|
|
||
|  using [this package](https://github.com/rsolomo/cargo-check) for older versions |
There was a problem hiding this comment.
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.
I'm willing to do that, sure
|
|
||
|  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.
nit: space after cargo check
src/rust-2018/global-allocators.md
Outdated
| @@ -0,0 +1,35 @@ | |||
| # Gobal allocators | |||
| @@ -0,0 +1 @@ | |||
| # Incremental Compilation for faster compiles | |||
There was a problem hiding this comment.
Looks like an accidental page? This is included in incremental-compilation.md
There was a problem hiding this comment.
other way around; that one is accidental but yes
|  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. |
| 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 |
| uses it by default. | ||
|
|
||
| As of Rust 1.23, we still defaulted to `hoedown`, but you could enable | ||
| Commonmark via a flag, `--enable-commonmark`. No newline at end of file |
There was a problem hiding this comment.
"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. |
|
|
||
| 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.
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.
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.
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.
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.
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.
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.
Hmm; having this in backticks highlights that this is code which is useful.
There was a problem hiding this comment.
an oversight! will fix
| @@ -0,0 +1,11 @@ | |||
| # std::os has documentation for all platforms | |||
There was a problem hiding this comment.
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.
This kinda looks like an array; I'd use underscore instead as a separator.
There was a problem hiding this comment.
we used this text in the release blog post and people were not generally confused
There was a problem hiding this comment.
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` |
src/introduction.md
Outdated
| Read on for more! No newline at end of file | ||
| 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.
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.
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.
I found the categories far more confusing, personally
There was a problem hiding this comment.
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.
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 :) |
|
|
||
|  | ||
|
|
||
| We're always working on erorr improvements, and there are little improvements |
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.
cratevisibility 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!