-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
(Mini) Rollup of 15 pull requests #23660
Commits on Mar 20, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 0c040b0 - Browse repository at this point
Copy the full SHA 0c040b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92294e7 - Browse repository at this point
Copy the full SHA 92294e7View commit details
Commits on Mar 21, 2015
-
Configuration menu - View commit details
-
Copy full SHA for c175b35 - Browse repository at this point
Copy the full SHA c175b35View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc9d9f2 - Browse repository at this point
Copy the full SHA bc9d9f2View commit details
Commits on Mar 22, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 90c8592 - Browse repository at this point
Copy the full SHA 90c8592View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5321d22 - Browse repository at this point
Copy the full SHA 5321d22View commit details -
Configuration menu - View commit details
-
Copy full SHA for fbc823d - Browse repository at this point
Copy the full SHA fbc823dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81801f2 - Browse repository at this point
Copy the full SHA 81801f2View commit details
Commits on Mar 23, 2015
-
Configuration menu - View commit details
-
Copy full SHA for d944689 - Browse repository at this point
Copy the full SHA d944689View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2750e3c - Browse repository at this point
Copy the full SHA 2750e3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d6fb7e9 - Browse repository at this point
Copy the full SHA d6fb7e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5e1cbe - Browse repository at this point
Copy the full SHA a5e1cbeView commit details -
Configuration menu - View commit details
-
Copy full SHA for d52c362 - Browse repository at this point
Copy the full SHA d52c362View commit details -
Configuration menu - View commit details
-
Copy full SHA for 05c9728 - Browse repository at this point
Copy the full SHA 05c9728View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1be8fcb - Browse repository at this point
Copy the full SHA 1be8fcbView commit details -
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions.
Configuration menu - View commit details
-
Copy full SHA for 248b2ec - Browse repository at this point
Copy the full SHA 248b2ecView commit details -
PR rust-lang#23104 moved `is_null` and `offset` to an inherent impl on the raw pointer type.
Configuration menu - View commit details
-
Copy full SHA for 3f52d71 - Browse repository at this point
Copy the full SHA 3f52d71View commit details
Commits on Mar 24, 2015
-
Rollup merge of rust-lang#22954 - ches:docs, r=steveklabnik
Greetings Rustaceans! I've just been getting acquainted with Rust through the guide. First let me say that it's already in great shape, chapters are kept a good length to be digestible and paced to move the reader along fluidly, so my compliments to contributors! Along the way I noticed a few minor copy errors, and also a few areas that I thought more subjectively could stand to be improved. My commits here are divided so that minor edits unlikely to be very contentious could be cherry-picked, and then topically on parts that might generate more discussion. I also have some comments and questions that aren't directly associated with any changes on this branch yet. I'm not sure how you like to triage this sort of thing but I'll present them below and if it's appropriate they could be moved to separate issues or I might be able to help work some of them out within the scope of this PR. Sorry that these are a lot to take in, pretty much everything below here can be digested independently of the current changes in this PR so you could read the rest later 😄 ### Questions and Comments I'll give stable links to doc revisions as of this writing. 1. The [example using `PartialEq` in the Traits chapter][1] is poor—we have no idea how `PartialEq` works at this point in the text (or at any point, AFAICT), so it isn't clear why it won't work as a trait bound in this situation and `Float` almost magically does, with the aid of existing tailor-made identity functions that seem unlikely to be so conveniently available when we encounter a scenario like this in our real-world code. This section just seems glossed over, or perhaps content has moved around over time or there's an assumption that implementing equality with `PartialEq` should be covered in the guide eventually so this example will be less foreign. As it stands the text is hard to follow and not very meaningful. 2. I found treatment of the relationship of trait objects to pointers in the *Static and Dynamic Dispatch* chapter unclear. [The "Why Pointers?" section][2] opens with this line: > The use of language like "fat pointer" implies that a trait object is always a pointer of some form, but why? But the phrase "fat pointer" hasn't been used anywhere before. This is some of the more complex material in the guide, but this section nevertheless feels displaced, not clearly connecting preceding subject matter. Earlier we've covered the internal representation of trait objects and significance of pointers they contain, but it hasn't been spelled out (other than what `&Foo` syntax suggests) that trait objects are references (and why). That's what the "Why Pointers?" section is aiming to do I gather, but it seems out of place, I think it'd make more sense to cover this before the gory details of their internals. 3. Suggestion: move the *Error Handling* chapter much earlier in the Intermediate section of the guide, or even into the Basics section. I know the Intermediate section isn't intended to be read in order per se, but plenty of people like me are just going to read it straight through anyway 😁 These are pretty fundamental concepts to understand and `Option`, `Result`, and idioms like `unwrap()` and `.ok().expect()` are referenced numerous times throughout the rest of the guide. They feature pretty prominently as early as *Standard Input* and *Guessing Game* chapters in Basics, in fact. I happen to have a good understanding of these already through encountering their analogs in typed functional languages, but if I didn't I believe I really would have appreciated reading *Error Handling* much earlier. 4. In the `rustdoc` chapter, a [comment at the beginning of the first source example][3] refers to a "link" crate attribute being needed. There seems to be no such attribute present in the source. I believe this refers to `crate_type` [according to the reference][4], but it'd be nice if this example were updated/clarified (I think `crate_id` is deprecated/obsolete too). This brings me to a related comment also: after encountering crate attributes in the reference and also docs on Cargo configuration like `crate-type = ["dylib"]`, I'm uncertain about the relationship/redundancy between these. I'm sure this is the kind of thing where docs are simply struggling to keep pace with rapid changes in Rust and Cargo, just wanted to flag that this distinction ought to be clearly covered in the docs for one or the other at some point, it's presently hard to track down. 5. Minor: link to sample editor configurations in [the introductory chapter][5] is broken, probably the generator automatically translates `.md` links to `.html`. Perhaps it shouldn't do that for absolute URLs. 6. Following from my changes to the enums coverage in [*Compound Data Types*][6] in this PR: sum types are an important topic and I tried to make some improvements, but I think the motivating example of `Character` with `Digit(i32)` and `Other` variants is a pretty weak one, and a better example could greatly improve cohesion with the `Ordering` coverage later in the section and how that ties into pattern matching in the subsequent chapter. I just haven't thought of a better example to suggest yet. In particular, the text states: > This may seem rather limiting, but it's a limitation which we can overcome. This is referring to `Character`, and actually to more than one limitation: the preceding admonition that its variants aren't comparable/don't have ordering, and don't support binary operators like `*` and `+`. Overcoming these limitations actually never gets explained—we next cover how `Ordering` works as an enum itself for plain `i32`s, but never get around to showing how this might be applied to our `Digit` variant type. Since the coverage of enums already segues into pattern matching and this could be even tighter with a stronger example, it might be nice if our example enum were somehow connected to the final example program for the Basics section too, where `Ordering` reappears. I don't see how it would fit with the current guessing game example, but food for thought. 7. `#[derive]` seems conspicuously missing from the guide. It would probably make sense to introduce after showing simple examples of implementing equality and/or ordering traits by hand, which have been mentioned as possibilities above. Perhaps it's too much to breach this as early as the Basic section though without traits being introduced. `#[derive]` itself and the derivable traits can certainly be saved for Intermediate and referenced as covered later, in any case. r? @steveklabnik for docs. [1]: https://github.com/rust-lang/rust/blob/157614249594f187f421cd97f928e64c5ab5c1fa/src/doc/trpl/traits.md#our-inverse-example [2]: https://github.com/rust-lang/rust/blob/157614249594f187f421cd97f928e64c5ab5c1fa/src/doc/trpl/static-and-dynamic-dispatch.md#why-pointers [3]: https://github.com/rust-lang/rust/blob/157614249594f187f421cd97f928e64c5ab5c1fa/src/doc/trpl/documentation.md#creating-documentation [4]: http://doc.rust-lang.org/reference.html#linkage [5]: https://github.com/rust-lang/rust/blob/157614249594f187f421cd97f928e64c5ab5c1fa/src/doc/trpl/hello-world.md [6]: https://github.com/rust-lang/rust/blob/157614249594f187f421cd97f928e64c5ab5c1fa/src/doc/trpl/compound-data-types.md#enums
Configuration menu - View commit details
-
Copy full SHA for 1f984c6 - Browse repository at this point
Copy the full SHA 1f984c6View commit details -
Rollup merge of rust-lang#23509 - aturon:stab-entry, r=aturon
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions. r? @gankro
Configuration menu - View commit details
-
Copy full SHA for 413c0c9 - Browse repository at this point
Copy the full SHA 413c0c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 566becb - Browse repository at this point
Copy the full SHA 566becbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b19ddb - Browse repository at this point
Copy the full SHA 2b19ddbView commit details -
Rollup merge of rust-lang#23607 - mahkoh:cursor, r=alexcrichton
Closes rust-lang#23599 r? @alexcrichton
Configuration menu - View commit details
-
Copy full SHA for 847118f - Browse repository at this point
Copy the full SHA 847118fView commit details -
Rollup merge of rust-lang#23608 - nagisa:refine-cursor-docstring, r=s…
…teveklabnik r? @steveklabnik
Configuration menu - View commit details
-
Copy full SHA for cc76e09 - Browse repository at this point
Copy the full SHA cc76e09View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a021fa - Browse repository at this point
Copy the full SHA 3a021faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 01e94e7 - Browse repository at this point
Copy the full SHA 01e94e7View commit details -
Rollup merge of rust-lang#23619 - steveklabnik:gh23220, r=alexcrichton
Fixes rust-lang#23571 I _think_ this is better, but other suggestions welcome too.
Configuration menu - View commit details
-
Copy full SHA for b5e841b - Browse repository at this point
Copy the full SHA b5e841bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 408e6bd - Browse repository at this point
Copy the full SHA 408e6bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 10ab1cb - Browse repository at this point
Copy the full SHA 10ab1cbView commit details -
Rollup merge of rust-lang#23639 - steveklabnik:gh21305, r=alexcrichton
Fixes rust-lang#21305 Not sure if we should include more than this here, but it should be good to have at least this.
Configuration menu - View commit details
-
Copy full SHA for 0175198 - Browse repository at this point
Copy the full SHA 0175198View commit details -
Configuration menu - View commit details
-
Copy full SHA for 12c7e37 - Browse repository at this point
Copy the full SHA 12c7e37View commit details -
Rollup merge of rust-lang#23644 - mbrubeck:doc-edit, r=steveklabnik
PR rust-lang#23104 moved `is_null` and `offset` to an inherent impl on the raw pointer type. I'm not sure whether or how it's possible to link to docs for that impl. r? @steveklabnik
Configuration menu - View commit details
-
Copy full SHA for 4c11af4 - Browse repository at this point
Copy the full SHA 4c11af4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01a7947 - Browse repository at this point
Copy the full SHA 01a7947View commit details