-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rollup of 10 pull requests #25340
Rollup of 10 pull requests #25340
Conversation
This isn't quite right, but it's interesting.
It compiles, yay.
Still compiling, but I think I have it!
I don't this we need to print the definition of the imported value too, though it's quite possible.
Corrected "Ownership": - [`Variable bindings`] link was not processed properly. - Changed the paragraph about move semantics with two vectors, because it was confusing. - Removed "So it may not be as inefficient as it initially seems", because there is nothing that seems inefficient in copying pointers only. - Other text corrections. Fixed copied-and-pasted text mistakes. Revised the paragraph about moving a vector (taking into account suggestions by echochamber). Fixed markdown. Fixes requested by steveklabnik. Brought back a sentence about supposed inefficiency.
core::slice was originally written to tolerate overflow (notably, with slices of zero-sized elements), but it was never updated to use wrapping arithmetic when overflow traps were added. Also correctly handle the case of calling .nth() on an Iter with a zero-sized element type. The iterator was assuming that the pointer value of the returned reference was meaningful, but that's not true for zero-sized elements. Fixes rust-lang#25016.
The previous assumptions were not valid for slices of zero-sized elements.
core::slice::Iter.ptr can be null when iterating a slice of zero-sized elements, but the pointer value used for the slice itself cannot. Handle this case by always returning a dummy pointer for slices of zero-sized elements.
`if` can be a statement or also an expression.
…ake it clear that it only populates inherent impls.
…rait's impls from all the crates.
This isn't quite right, but it's interesting.
The loop to load all the known impls from external crates seems to have been used because `ty::populate_implementations_for_trait_if_necessary` wasn't doing its job, and solely relying on it resulted in loading only impls in the same crate as the trait. Coherence for `librustc` was reduced from 18.310s to 0.610s, from stage1 to stage2. Interestingly, type checking also went from 46.232s to 42.003s, though that could be noise or unrelated improvements. On a smaller scale, `fn main() {}` now spends 0.003s in coherence instead of 0.368s, which fixes rust-lang#22068. It also peaks at only 1.2MB, instead of 16MB of heap usage.
These two traits are commonly confused. As such, explain the difference. Fixes rust-lang#24163 r? @aturon
…bnik I corrected some pretty obvious textual mistakes. One thing requires more attention - the paragraph at line 133 in Ownership. It was confusing, so I changed it, but I am no sure if this is what the author had in mind.
Add diagnostic message for E0317, E0154, E0259 and E0260; part of rust-lang#24407. About E0317, I was unsure if I should add an example of what could be wrong, such as `struct i64`, `enum char { A, B }` or `type isize = i64`. I decided against it, since the diagnostic message looks clear enough to me. What do you think?
`if` can be a statement or also an expression.
…anishearth At the moment, http://doc.rust-lang.org/error-index.html isn't linked to from anywhere (except Reddit). This should allow search engines to find error codes! I also capitalised "The Standard Library" and neatened a few bits of grammar. Also fixed: `#[main]` inside one of the error descriptions.
…anual, r=steveklabnik I did a read through of the manual. This commit corrects various small points and expands some sections, while avoiding too much detail. r? @steveklabnik
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ p=10 |
📌 Commit 2581565 has been approved by |
💔 Test failed - auto-linux-64-nopt-t |
@bors: retry force |
⚡ Previous build results for auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-64-opt are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-mac-32-opt, auto-win-32-nopt-t, auto-win-32-opt, auto-win-64-nopt-t... |
💔 Test failed - auto-linux-64-nopt-t |
@bors: retry force |
@bors: retry |
@bors: force |
⚡ Previous build results for auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-64-nopt-t, auto-win-64-opt are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-win-32-nopt-t, auto-win-32-opt... |
if
more generic #25322, Correct claims about &T's Copyness. #25327, Two regression tests. #25329, Add wait and waitpid to libc. #25330, Add a link to the error index to the main doc page. #25331, Minor corrections to reference manual #25335