bors [Wed, 2 Mar 2016 14:35:33 +0000 (14:35 +0000)]
Auto merge of #32000 - xaocon:master, r=steveklabnik
Vectors come up in sections dedicated to ownership with the assumption that we know something about it but we haven't seen it yet. On the other hand, you need not know anything about ownership or lifetimes to understand the basics of vectors covered in the vector section of the book. Additionally, by moving it where it is there is a natural progression from loops to an iterative type which discusses for loops. This kind of interaction is generally better for learning.
I would like to have moved the struct section as well but I'm less confident about how to handle it since the ownership sections discuss structs and the structs section talks about mutable borrow.
Rollup merge of #31985 - ashleysommer:libbackgrace_emscripten_fix, r=alexcrichton
Was getting error:
```
running: "sh" "/home/flubba86/rust/src/libstd/../libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=asmjs-unknown-emscripten" "--build=x86_64-unknown-linux-gnu"
...
Invalid configuration `asmjs-unknown-emscripten': system `emscripten' not recognized
```
This commit adds the emscripten target to the libbacktrace configure script so it is no longer unrecognized.
Rollup merge of #31982 - apasel422:sync, r=alexcrichton
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others.
Evan [Wed, 2 Mar 2016 00:50:11 +0000 (19:50 -0500)]
Make book ordering more natural
Vectors come up in sections dedicated to ownership with the assumption that we know something about it but we haven't seen it yet. On the other hand, you need not know anything about ownership or lifetimes to understand the basics of vectors covered in the vector section of the book. Additionally, by moving it where it is there is a natural progression from loops to an iterative type which discusses for loops. This kind of interaction is generally better for learning.
I would like to have moved the struct section as well but I'm less confident about how to handle it since the ownership sections discuss structs and the structs section talks about mutable borrow.
Explicitly opt out of `Sync` for `cell` and `mpsc` types
These types were already `!Sync`, but this improves error messages when
they are used in contexts that require `Sync`, aligning them with
conventions used with `Rc`, among others.
Steve Klabnik [Tue, 1 Mar 2016 18:39:42 +0000 (13:39 -0500)]
Rollup merge of #31984 - xaocon:master, r=steveklabnik
Had a discussion at https://www.reddit.com/r/rust/comments/488mjv/borrowing_or_returning_ownership/ about how an example could be worded more clearly and tried to take my recommendation and expand upon it with further information provided in the post.
Steve Klabnik [Tue, 1 Mar 2016 18:39:41 +0000 (13:39 -0500)]
Rollup merge of #31965 - miqid:doc, r=steveklabnik
Hello.
Quite a few of the links in the `core` module concerning redirection to additional primitive type documentation are broken. I noticed in #30214 that there seemed to be a consensus with linking across to `std` module documentation from the `core` module. This is what I've done with the `core` modules for primitive types.
If the changes here are good to go forward with, I'll happily tend to adding more documentation links for the extension traits in the aforementioned issue if need be.
bors [Tue, 1 Mar 2016 14:46:04 +0000 (14:46 +0000)]
Auto merge of #31939 - killercup:patch-17, r=brson
Use unordered nested list for stabilised APIs to improve readability. This makes the release notes for 1.7 a bit longer, but I don't think we should optimise for brevity here. It's a bit inconsistent since the other releases are not done this way, so feel free to ignore this change.
Also:
- Add link to `u32::checked_neg`
- Remove trailing back tick from BTreeMap line
bors [Tue, 1 Mar 2016 07:43:52 +0000 (07:43 +0000)]
Auto merge of #31335 - SimonSapin:ascii-into, r=alexcrichton
The default implementations (with `where Self: Sized`) are so that methods that take `self` by value can exist in a trait that’s implemented for dynamically-sized types (`str` and `[u8]`).
CC https://github.com/rust-lang/rust/issues/27809#issuecomment-177564950
CC @alexcrichton
bors [Tue, 1 Mar 2016 04:44:56 +0000 (04:44 +0000)]
Auto merge of #31713 - alexcrichton:rustbuild-docs, r=brson
This commit implements documentation generation of the nomicon, the book, the
style guide, and the standalone docs. New steps were added for each one as well
as appropriate makefile targets for each one as well.
Evan [Tue, 1 Mar 2016 04:22:30 +0000 (23:22 -0500)]
Clarified the details of a borrowing example.
Had a discussion at https://www.reddit.com/r/rust/comments/488mjv/borrowing_or_returning_ownership/ about how an example could be worded more clearly and tried to take my recommendation and expand upon it with further information provided in the post.
bors [Mon, 29 Feb 2016 22:30:44 +0000 (22:30 +0000)]
Auto merge of #31884 - alexcrichton:no-bootstrap-from-existing, r=brson
These commits add support to the rustbuild build system to compile non-build-system compilers. For example this will allow creating an ARM compiler on a x86 system. The high level way this works is:
* The only compiler ever run is the build target compiler. No other compiler is assumed to be runnable.
* As a result, all output artifacts come from the build compiler.
* The libs for the stageN cross-compiled compiler will be linked into place after the build target builds them.
This will break the assumption that a compiler never links to anything it didn't itself produce, but it retains the assumption that a compiler only ever links to anything built in the same stage. I believe this means that the stage1 cross-compiled compilers will still be usable.
I tested this by creating an `arm-unknown-linux-gnueabihf` compiler. So far the linking ended up all working OK (including LLVM being cross compiled), but I haven't been able to run it yet (in QEMU for a raspberry pi). I think that's because my system linker is messed up or something like that (some newer option is assumed when it's not actually there).
Overall, though, this means that rustbuild can compile an arm-unknown-linux-gnueabihf compiler. Ideally we could even start shipping nightlies based on this at some point!
Alex Crichton [Mon, 29 Feb 2016 17:34:13 +0000 (09:34 -0800)]
test: Mark all rpass-valgrind as no-prefer-dynamic
This applies the same fix as added in 595d5b2f which is to just compile all
valgrind tests statically instead of dynamically. It looks like this is a
resurgence of either #30383 or #31328 in some weird fashion.
I'm not actually sure what's going on with the bots, and it's unclear whether
this is a valgrind bug or a libstd bug, but for now let's just get things
landing again.
Alex Crichton [Thu, 25 Feb 2016 07:50:32 +0000 (23:50 -0800)]
rustbuild: Add steps for linking a sysroot
When cross compiling for a new host, we can't actually run the host compiler to
generate its own libs. In theory, however, all stage2 compilers (for any host)
will produce the same libraries, so we just require the build compiler to
produce the necessary host libraries and then we link those into place.
Alex Crichton [Thu, 25 Feb 2016 03:04:35 +0000 (19:04 -0800)]
rustbuild: Compile with the build compiler
This switches the defaults to ensure that everything is built with the build
compiler rather than the host compiler itself (which we're not guaranteed to be
able to run)
Alex Crichton [Thu, 25 Feb 2016 01:09:17 +0000 (17:09 -0800)]
rustbuild: Enable cross-compiling LLVM
Currently all multi-host builds assume the the build platform can run the
`llvm-config` binary generated for each host platform we're creating a compiler
for. Unfortunately this assumption isn't always true when cross compiling, so we
need to handle this case.
This commit alters the build script of `rustc_llvm` to understand when it's
running an `llvm-config` which is different than the platform we're targeting for.
Alex Crichton [Wed, 24 Feb 2016 07:00:48 +0000 (23:00 -0800)]
rustbuild: Enable bootstrapping new hosts
This commit fixes a longstanding issue with the makefiles where all host
platforms bootstrap themselves. This commit alters the build logic for the
bootstrap to instead only bootstrap the build triple, and all other compilers
are compiled from that one compiler.
The benefit of this change is that we can cross-compile compilers which cannot
run on the build platform. For example our builders could start creating
`arm-unknown-linux-gnueabihf` compilers.
This reduces the amount of bootstrapping we do, reducing the amount of test
coverage, but overall it should largely just end in faster build times for
multi-host compiles as well as enabling a feature which can't be done today.
bors [Sat, 27 Feb 2016 20:26:59 +0000 (20:26 +0000)]
Auto merge of #31931 - Luke-Nukem:master, r=steveklabnik
Refinement of paragraph referenced by [this issue](https://github.com/rust-lang/rust/issues/31927).
The paragraph in question had been adjusted already, but I've made some further clarifications which should help with readability and not leave the reader any `dangling pointers`.
bors [Sat, 27 Feb 2016 06:58:28 +0000 (06:58 +0000)]
Auto merge of #31926 - llogiq:more_post, r=eddyb
These `_post` methods are quite helpful to control lint behavior without storing e.g. block node ids. So here are a few more I believe will be helpful.
mitaa [Fri, 26 Feb 2016 16:19:35 +0000 (17:19 +0100)]
Clearly separate code blocks from other blocks
For summary descriptions we need the first paragraph (adjacent lines
until a blank line) - but the rendered markdown of a code block did not
leave a blank line in the html and was thus included in the summary line.
Rollup merge of #31930 - miqid:doc, r=steveklabnik
Hello.
I've added links for items inside of some stable methods for consistency with existing ones that already have them. Also includes minor formatting fixes.
Rollup merge of #31929 - dotdash:less_rallocx, r=alexcrichton
When foldings Substs, we map over VecPerParamSpace instances using
EnumeratedItems which does not provide an accurate size_hint()
in its Iterator implementation. This leads to quite a large number or
reallocations. Providing a suitable size_hint() implementation reduces
the time spent in item-bodies checking quite a bit.
Rollup merge of #31926 - llogiq:more_post, r=eddyb
These `_post` methods are quite helpful to control lint behavior without storing e.g. block node ids. So here are a few more I believe will be helpful.
bors [Sat, 27 Feb 2016 01:15:23 +0000 (01:15 +0000)]
Auto merge of #31914 - bluss:copy-from-slice-everywhere, r=alexcrichton
Use .copy_from_slice() where applicable
.copy_from_slice() does the same job of .clone_from_slice(), but the
former is explicitly for Copy elements and calls `memcpy` directly, and
thus is it efficient without optimization too.
Björn Steinbrink [Fri, 26 Feb 2016 23:53:33 +0000 (00:53 +0100)]
Avoid excessive reallocations during item-bodies checking
When foldings Substs, we map over VecPerParamSpace instances using
EnumeratedItems which does not provide an accurate size_hint()
in its Iterator implementation. This leads to quite a large number or
reallocations. Providing a suitable size_hint() implementation reduces
the time spent in item-bodies checking quite a bit.