Steve Klabnik [Tue, 20 Oct 2015 13:43:47 +0000 (09:43 -0400)]
Rollup merge of #29175 - durka:patch-8, r=Gankro
Yay, markdown isn't standardized and rustbook's parser has subtle incompatibilities with Github's! So in the Github preview you don't see that this list fails to separate from the previous paragraph. I think this should fix it, but I didn't check.
bors [Tue, 20 Oct 2015 11:55:17 +0000 (11:55 +0000)]
Auto merge of #27723 - mystor:vecdeque_drain_range, r=bluss
This is a WIP PR for my implementation of drain over the VecDeque data structure supporting ranges. It brings the VecDeque drain implementation in line with Vec's.
Tests haven't been written for the new function yet.
bors [Tue, 20 Oct 2015 08:19:19 +0000 (08:19 +0000)]
Auto merge of #29152 - petrochenkov:derstab, r=alexcrichton
The attributes are copied from the item for which the trait impl is derived
I think now we can close these two issues:
https://github.com/rust-lang/rust/issues/13054 - `allow`, `deny` etc. were already copied, now `stable` and `unstable` are copied as well.
https://github.com/rust-lang/rust/issues/18969 - I'm not sure this is needed, insta-stability were good enough so far, copied stability will be better. Nonetheless, it can be subsumed by some more general mechanism for supplying arbitrary not necessarily stability related attributes (for example `inline`) to derived impls and their methods (I haven't found an open issue for such mechanism).
bors [Tue, 20 Oct 2015 06:36:50 +0000 (06:36 +0000)]
Auto merge of #29140 - sorear:dst-document-on-sized, r=alexcrichton
This is for discoverability. If someone wants to know what `?Sized` means, then
Sized will be the only keyword they can use to search; so even though this is
technically a language matter, it makes sense to document it where it will be
looked for.
bors [Tue, 20 Oct 2015 00:30:23 +0000 (00:30 +0000)]
Auto merge of #29009 - alexcrichton:std-pkgs, r=brson
This commit splits out the standard library from the current 'rustc' package
into a new 'rust-std' package. This is the basis for the work on easily
packaging compilers that can cross-compile to new targets.
Steve Klabnik [Mon, 19 Oct 2015 21:14:08 +0000 (17:14 -0400)]
Rollup merge of #29168 - aarzee:master, r=steveklabnik
Remove leading newlines; replace lines containing only whitespace with empty lines; replace multiple trailing newlines with a single newline; remove trailing whitespace in lines.
Steve Klabnik [Mon, 19 Oct 2015 21:14:08 +0000 (17:14 -0400)]
Rollup merge of #29165 - iajrz:patch-1, r=steveklabnik
To augment the didactic effect, made placed the thread::sleep_ms call in the last example, so that there will be time for the other locks to happen; without this, I was unable to observe the deadlock in over 1,000 runs when there was no left-handed philosopher.
Steve Klabnik [Mon, 19 Oct 2015 21:14:07 +0000 (17:14 -0400)]
Rollup merge of #29132 - sorear:document-ordering-relaxed, r=alexcrichton
I wasn't sure whether `Ordering::Relaxed` meant `Monotonic` or `Unordered`, so I checked the compiler sources and found https://github.com/rust-lang/rust/blob/206af38e74ce7fa4b0e781ece7f1067c018c580e/src/librustc_trans/trans/intrinsic.rs#L846 which appears conclusive. Adding this answer to the documentation.
Steve Klabnik [Mon, 19 Oct 2015 21:14:07 +0000 (17:14 -0400)]
Rollup merge of #29027 - steveklabnik:iter_docs, r=manishearth
Due to the way iterators work, the std::iter module is chock full of
structs that you, humble Rust programmer, will never actually use.
However, they have URLs, and therefore get linked to, because they are
real structs that do exist.
So, rather than just have a tiny sentence about each one of them,
this patch adds links back to the functions and methods on Iterator
which actually create the structs, where helpful documentation already
exists.
bors [Mon, 19 Oct 2015 17:05:40 +0000 (17:05 +0000)]
Auto merge of #28977 - arcnmx:cstring-into, r=alexcrichton
`OsString` has these sorts of conversions, while `CString` has been missing them. I'm iffy on `into_string` simply because the return type would be better off as `FromUtf8Error<CString>`, which of course isn't generic :cry:
Carlos Liam [Mon, 19 Oct 2015 15:16:31 +0000 (11:16 -0400)]
Clean whitespace
Remove leading newlines; replace lines containing only whitespace with empty lines; replace multiple trailing newlines with a single newline; remove trailing whitespace in lines
Made the example capable of consistent deadlocking
To augment the didactic effect, made placed the thread::sleep_ms call in the last example, so that there will be time for the other locks to happen; without this, I was unable to observe the deadlock in over 1,000 runs when there was no left-handed philosopher.
bors [Mon, 19 Oct 2015 12:45:25 +0000 (12:45 +0000)]
Auto merge of #29153 - arcnmx:thread-spawn, r=alexcrichton
Fixes #29128
Most of the weird lifetime things and `inner` stuff seems like leftover cruft from `thread::scoped`. Should `JoinInner` just be removed/merged with `JoinHandle`?
Also is it okay to remove the `FnBox`? I'm not really sure why there were two allocations there...
Stefan O'Rear [Sun, 18 Oct 2015 11:17:33 +0000 (04:17 -0700)]
Document DST parameters on std::marker::Sized
This is for discoverability. If someone wants to know what ?Sized means, then
Sized will be the only keyword they can use to search; so even though this is
technically a language matter, it makes sense to document it where it will be
looked for.
bors [Sun, 18 Oct 2015 11:09:03 +0000 (11:09 +0000)]
Auto merge of #28845 - oli-obk:rfc1229, r=pnkfelix
This PR turns statically known erroneous code (e.g. numeric overflow) into a warning and continues normal code-generation to emit the same code that would have been generated without `check_const` detecting that the result can be computed at compile-time.
<del>It's not done yet, as I don't know how to properly emit a lint from trans. I can't seem to extract the real lint level of the item the erroneous expression is in.</del> It's an unconditional warning now.
bors [Sun, 18 Oct 2015 08:20:38 +0000 (08:20 +0000)]
Auto merge of #29134 - wthrowe:linker-output-ICE, r=pnkfelix
The escaped form isn't pretty, but this should be a very rare error.
Having a general binary-escaping string creation function might be a
good idea, though.
William Throwe [Sun, 18 Oct 2015 03:54:48 +0000 (23:54 -0400)]
Don't ICE if the linker prints something non-UTF-8
The escaped form isn't pretty, but this should be a very rare error.
Having a general binary-escaping string creation function might be a
good idea, though.
bors [Sat, 17 Oct 2015 15:10:07 +0000 (15:10 +0000)]
Auto merge of #29089 - kickinbahk:edit-testing-docs, r=steveklabnik
When going through the docs, it is not clear that binary files cannot be tested. Additionally, it is hard to find the proper structure of a Rust crate and it took me several hours of looking through the docs to find the crates and modules section. I think we can link to it from here and it will be beneficial to those who are coming to the language.
bors [Sat, 17 Oct 2015 06:16:09 +0000 (06:16 +0000)]
Auto merge of #29102 - petrochenkov:spanvis, r=alexcrichton
Closes https://github.com/rust-lang/rust/issues/28750
`Arm` and `Generics` don't have spans at all, so it's not a visitor's problem, `visit_struct_def` was fixed in https://github.com/rust-lang/rust/pull/28816
are not used. I am not sure if removing them is the right way to go. If it makes sense to keep (and fix and enable) them, I would be happy to update the PR.
1. It makes `Arc<T>` and `Rc<T>` covariant in `T`.
2. It causes the compiler to reject code that was unsound with respect
to dropck. See compile-fail/issue-29106.rs for an example of code that
no longer compiles. Because of this, this is a [breaking-change].
Alex Crichton [Fri, 16 Oct 2015 19:42:36 +0000 (12:42 -0700)]
mk: Fix compile for mips
* Don't pass `-mno-compact-eh`, apparently not all compilers have this?
* Don't pass `+o32`, apparently LLVm doesn't recognize this
* Use `mipsel-linux-gnu` as a prefix instead of `mipsel-unknown-linux-gnu`, this
matches the ubuntu package at least!
bors [Fri, 16 Oct 2015 17:47:01 +0000 (17:47 +0000)]
Auto merge of #29014 - petrochenkov:stability, r=brson
Stricter checking of stability attributes + enforcement of their invariants at compile time
(+ removed dead file librustc_front/attr.rs)
I intended to enforce use of `reason` for unstable items as well (it normally presents for new items), but it turned out too intrusive, many older unstable items don't have `reason`s.
r? @aturon
I'm studying how stability works and do some refactoring along the way, so it's probably not the last PR.
bors [Fri, 16 Oct 2015 06:24:11 +0000 (06:24 +0000)]
Auto merge of #29081 - rust-lang:arc-example-edit, r=alexcrichton
The text says it's a vector of floats, but the code actually uses a vector of integers. The type of the Vec doesn't really matter, so I just cut it from the text.
bors [Fri, 16 Oct 2015 03:10:30 +0000 (03:10 +0000)]
Auto merge of #29080 - Havvy:remove_doc_style_changing, r=alexcrichton
Fixes issue #29077.
There **are** API changing guidelines in the RFCs, so it might be prudent to put those there. But I'm leaving that up to another person. This PR just removes bad documentation.
kickinbahk [Fri, 16 Oct 2015 00:44:21 +0000 (17:44 -0700)]
Add to Testing docs to make more clear
When going through the docs, it is not clear that binary files cannot be tested. Additionally, it is hard to find the proper structure of a Rust crate and it took me several hours of looking through the docs to find the crates and modules section. I think we can link to it from here and it will be beneficial to those who are coming to the language.
Alex Crichton [Tue, 13 Oct 2015 00:24:30 +0000 (17:24 -0700)]
mk: Split out a standard library package
This commit splits out the standard library from the current 'rustc' package
into a new 'rust-std' package. This is the basis for the work on easily
packaging compilers that can cross-compile to new targets.
bors [Thu, 15 Oct 2015 21:21:27 +0000 (21:21 +0000)]
Auto merge of #29031 - cristicbz:mtx_inner, r=alexcrichton
The implementation for `into_inner` was a bit more complex than I had hoped for---is there any simpler, less unsafe way of getting around the fact that one can't move out of a `Drop` struct?
Matt Brubeck [Thu, 15 Oct 2015 20:52:51 +0000 (13:52 -0700)]
Fix minor error in Arc docs
The text says it's a vector of floats, but the code actually uses a vector of integers. The type of the Vec doesn't really matter, so I just cut it from the text.