Commit Graph

53823 Commits

Author SHA1 Message Date
Carol (Nichols || Goulding)
fc467b31c2 Reorder Copy doc sections
The new order puts all the "when" questions together and puts the "how"
question with the "derivable" section. So you have to scroll past (and
hopefully read) the can/cannot/should caveats and guidelines to get to
the information about how to actually go about doing it once you've
determined that you can and should, with derivable information first so
that you can just use the derived implementation if that applies.

Previous order:

* General explanation
* When can my type be `Copy`?
* How can I implement `Copy`?
* When can my type _not_ be `Copy`?
* When should my type be `Copy`?
* Derivable

New order:

* General explanation
* When can my type be `Copy`?
* When can my type _not_ be `Copy`?
* When should my type be `Copy`?
* Derivable
* How can I implement `Copy`?
2016-05-23 10:03:44 -04:00
Carol (Nichols || Goulding)
2f44053332 Make Derivable header be an h2 instead of an h1
This matches the other subsections.
2016-05-23 10:03:44 -04:00
Carol (Nichols || Goulding)
bbfb6e762b derive explanation for PartialOrd should match that for Ord
I think these just got out of sync, but both use a lexicographic
ordering.

Relevant commits in the history of these explanations:
* 8b81f76 on 2015-06-30
* e22770b on 2016-02-09
2016-05-23 10:03:44 -04:00
Carol (Nichols || Goulding)
1e493fd979 Add explanations about what derived trait implementations do 2016-05-23 10:03:44 -04:00
Felix S. Klock II
0796ee77ba add indexed_set mod for typed wrappers around bitarrays representing sets.
It provides an `Idx` trait for usize wrappers used to represent the
elements of such sets.
2016-05-23 14:31:52 +02:00
Tamir Bahar
bb94e6a739 Fixed link in Rust Book (no-stdlib)
Fix a broken link in the rust book.
2016-05-23 14:42:47 +03:00
bors
4c6b6c200b Auto merge of #33098 - raphlinus:master, r=alexcrichton
Efficient trie lookup for boolean Unicode properties

Replace binary search of ranges with trie lookup using leaves of
64-bit bitmap chunks. Benchmarks suggest this is approximately 10x
faster than the bsearch approach.
2016-05-23 02:48:11 -07:00
Masood Malekghassemi
808e4315e8 Propagate obligations through projection 2016-05-22 23:35:38 -07:00
bors
6e45564095 Auto merge of #31457 - lambda:rtabort-use-libc-abort, r=alexcrichton
Use libc::abort, not intrinsics::abort, in rtabort!

intrinsics::abort compiles down to an illegal instruction, which on
Unix-like platforms causes the process to be killed with SIGILL.  A more
appropriate way to kill the process would be SIGABRT; this indicates
better that the runtime has explicitly aborted, rather than some kind of
compiler bug or architecture mismatch that SIGILL might indicate.

For rtassert!, replace this with libc::abort.  libc::abort raises
SIGABRT, but is defined to do so in such a way that it will terminate
the process even if SIGABRT is currently masked or caught by a signal
handler that returns.

On non-Unix platforms, retain the existing behavior.  On Windows we
prefer to avoid depending on the C runtime, and we need a fallback for
any other platforms that may be defined.  An alternative on Windows
would be to call TerminateProcess, but this seems less essential than
switching to using SIGABRT on Unix-like platforms, where it is common
for the process-killing signal to be printed out or logged.

This is a [breaking-change] for any code that depends on the exact
signal raised to abort a process via rtabort!

cc #31273
cc #31333
2016-05-22 23:14:11 -07:00
Brian Campbell
cfc3865832 Use libc::abort, not intrinsics::abort, in rtabort!
intrinsics::abort compiles down to an illegal instruction, which on
Unix-like platforms causes the process to be killed with SIGILL.  A more
appropriate way to kill the process would be SIGABRT; this indicates
better that the runtime has explicitly aborted, rather than some kind of
compiler bug or architecture mismatch that SIGILL might indicate.

For rtassert!, replace this with libc::abort.  libc::abort raises
SIGABRT, but is defined to do so in such a way that it will terminate
the process even if SIGABRT is currently masked or caught by a signal
handler that returns.

On non-Unix platforms, retain the existing behavior.  On Windows we
prefer to avoid depending on the C runtime, and we need a fallback for
any other platforms that may be defined.  An alternative on Windows
would be to call TerminateProcess, but this seems less essential than
switching to using SIGABRT on Unix-like platforms, where it is common
for the process-killing signal to be printed out or logged.

This is a [breaking-change] for any code that depends on the exact
signal raised to abort a process via rtabort!

cc #31273
cc #31333
2016-05-23 00:22:41 -04:00
Alex Ozdemir
57ab0edaf0 Fixed shortcut handling. Reverted to [Shift]+[+=]
Realized browsers use [Ctrl]+[+=] for zoom, so using [Shift]+[+=] for
collapse/expand was not necessarily a conflict.

Also a bugfix.
2016-05-22 18:17:49 -07:00
ggomez
145747ebfc Don't suggest using fields in a static method 2016-05-23 01:18:06 +02:00
Nick Cameron
5106ce7bfb save-analysis: use a function's short name 2016-05-23 10:23:36 +12:00
Daniel Firth
6e9774f4bb Fix misleading intentation errors on gcc 6.0 2016-05-22 20:47:59 +01:00
Alex Ozdemir
01dc9f0be4 Changed toggle all sections key to T
Allows both `T` and `t`.

It had been [Shift]+[+] before.
2016-05-22 12:47:53 -07:00
Srinivas Reddy Thatiparthy
3d9d96b6da run rustfmt on libcollections test module 2016-05-22 23:57:13 +05:30
ggomez
62e387102a Add new error code tests 2016-05-22 19:26:21 +02:00
Wangshan Lu
226bcdf7d1 Rename main thread from "<main>" to "main".
Fix issue #33789
2016-05-22 22:42:10 +08:00
Josh Stone
1cae0c5c05 bootstrap: mirror mk's local-rebuild changes
The rustc for a local-rebuild is assumed to use the current bootstrap
key and already match the current stage1 features.
2016-05-22 00:09:33 -07:00
Josh Stone
3406c55144 mk: Add --enable-local-rebuild to bootstrap from the current release
In Linux distributions, it is often necessary to rebuild packages for
cases like applying new patches or linking against new system libraries.
In this scenario, the rustc in the distro build environment may already
match the current release that we're trying to rebuild.  Thus we don't
want to use the prior release's bootstrap key, nor `--cfg stage0` for
the prior unstable features.

The new `configure --enable-local-rebuild` option specifies that we are
rebuilding from the current release.  The current bootstrap key is used
for the local rustc, and current stage1 features are also assumed.
2016-05-22 00:09:33 -07:00
bors
e24d621fca Auto merge of #33765 - alex-ozdemir:master, r=Manishearth
Added a `rustdoc` shortcut for collapse/expand all

Now when the user presses the "+" key all sections will collapse/expand.

Also added a note to the help screen which describes this behavior.

This required increasing the height of the help screen.
2016-05-21 23:58:57 -07:00
bors
14d6a10c59 Auto merge of #33752 - mrhota:internal_docs, r=steveklabnik
Internal docs

This PR is a rebase of #30621. That PR can be closed.

CC @ticki @Aatch @cyplo
2016-05-21 17:27:29 -07:00
Guillaume Gomez
30dd087baa Update repr_simd 2016-05-22 01:13:26 +02:00
Jeffrey Seyfried
3c421ac67e Test diagnostics 2016-05-21 23:02:34 +00:00
Jeffrey Seyfried
ba8b9324d6 Move placement_in_syntax gated feature checking from expansion to the post-expansion visitor 2016-05-21 23:02:34 +00:00
Jeffrey Seyfried
82b49cd200 Refactor away check_attributes 2016-05-21 23:01:02 +00:00
Jeffrey Seyfried
a3d705ef30 Refactor away expand_item_mac 2016-05-21 23:01:02 +00:00
Jeffrey Seyfried
3192adbf87 Refactor out mac_result in expand_mac_invoc 2016-05-21 23:01:02 +00:00
Jeffrey Seyfried
215c1460f6 Check attributes in expand_mac_invoc 2016-05-21 23:01:02 +00:00
Jeffrey Seyfried
f4075e9467 Use expand_mac_invoc in expand_pat 2016-05-21 23:01:01 +00:00
Jeffrey Seyfried
8ee93b73d1 Re-fold expanded items in expand_mac_invoc 2016-05-21 23:01:01 +00:00
Jeffrey Seyfried
2e7afd7367 Improve diagnostics 2016-05-21 23:01:01 +00:00
Jeffrey Seyfried
7f30eef2ee Introduce MacroGenerable trait 2016-05-21 23:00:57 +00:00
bors
476fe6eefe Auto merge of #33767 - sfackler:panic-hook-docs, r=alexcrichton
Mention that the panic hook will always run

r? @alexcrichton

cc @tomaka
2016-05-21 10:17:40 -07:00
Ticki
da55fd788b Improve internal documentation and code style
Fix some code layout, remove some unnecessary returns, fix typos,
punctuation, and comment consistency.
2016-05-21 08:51:08 -05:00
bors
da41920919 Auto merge of #33768 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #33578, #33679, #33743, #33746, #33747, #33750, #33757
- Failed merges:
2016-05-21 00:38:55 -07:00
Aaklo Xu
4c7b963862 src/doc: Keep the original style of links 2016-05-21 14:40:57 +08:00
Manish Goregaokar
61b9be776e Rollup merge of #33757 - GuillaumeGomez:simd, r=steveklabnik
Update simd syntax

r? @steveklabnik
2016-05-21 09:08:11 +05:30
Manish Goregaokar
197aa52de3 Rollup merge of #33750 - alx741:fix_typo, r=Manishearth
book: ownership: fix typo

The sentence ends there, so a comma is required.

See:
http://english.stackexchange.com/questions/1469/when-ending-a-list-with-etc-should-there-be-a-comma-before-etc
2016-05-21 09:08:10 +05:30
Manish Goregaokar
f262bb899c Rollup merge of #33747 - postmodern:patch-2, r=Manishearth
Clarify the English translation of `?Sized`

* It wasn't clear whether `?Sized` meant "not `Sized`" or "`Sized` or not `Sized`". According to #rust IRC, it does indeed mean "`Sized` or not `Sized`".
* Use the same language as [Trait std::marker::Sized](https://doc.rust-lang.org/std/marker/trait.Sized.html) about how `Sized` is implicitly bound.
* Refer to the syntax as `?Sized`, since it's currently the only allowed trait that can follow `?`.
2016-05-21 09:08:10 +05:30
Manish Goregaokar
c57bb106d8 Rollup merge of #33746 - dns2utf8:doc_sort_memory, r=steveklabnik
Clarify docs for sort(&mut self)

I documented the memory usage like noted in this issue:
  * Document memory usage of sort() family of functions #33419
2016-05-21 09:08:10 +05:30
Manish Goregaokar
0c949d8cc3 Rollup merge of #33743 - royalstream:royalstream-stack-doc, r=steveklabnik
Book: small improvement to a table to make it clearer

This table is used as an example of four heap values where two of them got deallocated leaving a gap.
It also has stack variables.
Instead of four stack variables I propose three, that way there's no misleading connection between the number of stack variables and heap variables.
But more importantly: three of the four stack variables had the same name (**y**) which could be confusing to a beginner, I changed this as well.
2016-05-21 09:08:10 +05:30
Manish Goregaokar
3f4d915147 Rollup merge of #33679 - Manishearth:rustdoc-readmore-impls, r=alexcrichton
rustdoc: Add doc snippets for trait impls, with a read more link

The read more link only appears if the documentation is more than one line long.

![screenshot from 2016-05-17 06 54 14](https://cloud.githubusercontent.com/assets/1617736/15308544/4c2ba0ce-1bfc-11e6-9add-29de8dc7ac6e.png)

It currently does not appear on non-defaulted methods, since you can document them directly. I could make it so that default documentation gets forwarded if regular docs don't exist.

Fixes #33672

r? @alexcrichton

cc @steveklabnik
2016-05-21 09:08:09 +05:30
Manish Goregaokar
87a22885a0 Rollup merge of #33578 - durka:patch-21, r=alexcrichton
update tracking issue for once_poison

The tracking issue for once_poison was noted as #31688 which was closed, so it now points to the new #33577.
2016-05-21 09:08:09 +05:30
bors
91e907345c Auto merge of #33625 - alexcrichton:rustbuild-moar-tests, r=aturon
rustbuild: Touch up some test suites

This adds in some missing test suites, primarily a few pretty suites. It also starts optimizing tests by default as the current test suite does, but also recognizes `--disable-optimize-tests`.

Currently the optimization of tests isn't recognized by crate tests because Cargo doesn't support the ability to compile an unoptimized test suite against an optimized library. Perhaps a feature to add, though!
2016-05-20 20:33:38 -07:00
Alex Ozdemir
ab09fbca23 Added a rustdoc shortcut for collapse/expand all
Now when the user presses the "+" key all sections will collapse/expand.

Also added a note to the help screen which describes this behavior.
2016-05-20 19:43:47 -07:00
Postmodern
71af58accf Wording changes
* Use "special bound syntax" instead of "special syntax". `?Sized` is technically a "bound", but `?Sized` is specialized syntax that _only_ works with `Sized`, and no other Trait.
* Replace "constant size" with "sized".
2016-05-20 17:47:34 -07:00
Alex Burka
b9d1e76252 update tracking issue for once_poison
The tracking issue for once_poison was noted as #31688 which was closed, so it now points to the new #33577.
2016-05-20 20:30:08 -04:00
bors
500e5c15cb Auto merge of #33758 - GuillaumeGomez:rollup, r=Manishearth
Rollup of 6 pull requests

- Successful merges: #33668, #33676, #33683, #33734, #33739, #33745
- Failed merges: #33578
2016-05-20 16:37:01 -07:00
Alex Crichton
5f295f22a7 rustc: Fix again order-dependence in extern crate
Originally fixed in #29961 the bug was unfortunately still present in the face
of crates using `#[macro_use]`. This commit refactors for the two code paths to
share common logic to ensure that they both pick up the same bug fix.

Closes #33762
2016-05-20 14:03:47 -07:00