| Age | Commit message (Collapse) | Author | Lines |
|
The example code for higher-ranked trait bounds on closures had an
unnecessary `mut` which was confusing, and the text referred to an
mutable reference which does not exist in the code (and isn't needed).
Removed the `mut`s and fixed the text to better describe the actual
error for the failing example.
|
|
Remove un-rendered ticks from "const and static" doc title
Related to #37116 and #37119.
Ticks in the titles are not correctly rendered

|
|
The original sentence is:
> This example has two conversions: `Rc<String>` to `String` and then `String` to `&str`.
But it should be
> This example has two conversions: `Rc<String>` to `String` and then `String` to `str`.
or
> This example has two conversions: `&Rc<String>` to `&String` and then `&String` to `&str`.
I think the latter is more clearly.
|
|
|
|
The main change is to stop using javascript to generate the URLs and use
rustdoc instead.
This also adds run buttons to the error index examples.
|
|
book: remove backticks in Type Aliases header
Fix #37116.
|
|
Explain motivation behind lifetimes
Start the lifetime section with an explanation of the issues that lack of explicit lifetimes cause and how the explicit lifetimes solve these.
----------------
I had really hard time figuring out why I would need to care about the explicit reference lifetimes when going through the book at first. With strong background in C++, I'm familiar with the dangling reference problem - but given the section seems to focus more on the lifetime syntax and various ways to define lifetimes on functions and structs, I was unable to understand how they are used to solve the reference problem.
This PR is an attempt at getting the reader to understand what the explicit lifetimes are used for and why they are an awesome thing instead of a bit of syntax that just has to be written.
It's been less than a week that I've been diving into Rust so I'm far from certain about the terminology and technical correctness. I tried mimicking the existing terminology from the lifetimes section, but still no promises on getting it right.
|
|
Start the lifetime section with an explanation of the issues that
lack of explicit lifetimes cause and how lifetimes alleviate these.
|
|
stabilise ?, attributes on stmts, deprecate Reflect
r? @nikomatsakis
|
|
Fix #37116.
|
|
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag.
cc [Tracking issue](https://github.com/rust-lang/rust/issues/15701)
|
|
Book: Be very explicit of lifetimes being descriptive
... not prescriptive. Pointed out in https://users.rust-lang.org/t/what-if-i-get-lifetimes-wrong/7535/4, which was a revelation to me and made me think this should be more clear in the book. I'm not sure if I got this entirely right or if the wording is good, but I figured a PR is more helpful than a simple issue.
r? @steveklabnik
Small Note: There's also https://github.com/rust-lang/book, should I have sent the PR there? It doesn't coincide with the online book though, so I figured it's better of here.
|
|
reference: use ticks instead of quotes
|
|
Reference: Mention `move` keyword for lambdas
From issue #36683
|
|
|
|
|
|
Minor modifications in concurrency section of the Rust book
Fixes #36939
r? @steveklabnik
|
|
|
|
|
|
Also, emphasize differently.
|
|
... no prescriptive. Pointed out in https://users.rust-lang.org/t/what-if-i-get-lifetimes-wrong/7535/4, which was a revelation to me and made me think this should be more clear in the book.
|
|
|
|
|
|
As it stands, getting-started and guessing-game both introduce `run` as
a new command. The second should probably make it clear that the reader
has seen it before :)
|
|
Add `Send` and `Sync` traits to the reference
Fixes #36859
|
|
Suggesting a change to a comment that puzzled me
While reading this, the comment made it difficult for me to simply absorb the concept. It interrupted my reading flow, and I think this expresses the same meaning, but reads a bit better. It's trivial, but makes it easier for me to move on to the next line.
|
|
Fixes #36859
|
|
Add docs for "!" Never type (rfc 1216)
Pull Request: https://github.com/rust-lang/rfcs/pull/1216
Tracking Issue: #35121
|
|
doc: Fix minor typo in book/variable-bindings.md
r? @steveklabnik
|
|
|
|
|
|
|
|
Docs: Update to "Getting Started" section
I came across #34523 and wanted to suggest a solution. See commit for details.
It seemed like a good place to start contributing, let me know if I did anything wrong 😇
|
|
|
|
Docs: Update to "Ownership" section
Found #34865 while looking for easy docs wins I could contribute with.
|
|
While reading this, the comment made it difficult for me to simply absorb the concept. It interrupted my reading flow, and I think this expresses the same meaning, but reads a bit better.
|
|
- Reword
- Add link
|
|
- Updated paragraphs and wording for clarity.
- Renamed `helloworld.rs` to `myprogram.rs` to make it clearer that it's an unrelated example.
|
|
|
|
|
|
book: fix mistake (File::open -> File::create)
|
|
book: fix a typo
|
|
|
|
|
|
Fixed typo in nomicon
|
|
|
|
add static_in_const feature gate
also updates tests and deletes the spurious .bk files I inadvertently added last time.
r? @nikomatsakis
|
|
|
|
|
|
|