]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAdd an explicit "How can I implement `Eq`" doc section
Carol (Nichols || Goulding) [Sat, 21 May 2016 17:05:15 +0000 (13:05 -0400)]
Add an explicit "How can I implement `Eq`" doc section

Building on the example in PartialEq.

8 years agoAdd an explicit "How can I implement `PartialEq`"? doc section
Carol (Nichols || Goulding) [Sat, 21 May 2016 16:55:13 +0000 (12:55 -0400)]
Add an explicit "How can I implement `PartialEq`"? doc section

Including an example of a custom implementation. I put this expanded
section after the `Derivable` section to encourage use of that first.

8 years agoReorder `Copy` doc sections
Carol (Nichols || Goulding) [Sat, 21 May 2016 15:54:29 +0000 (11:54 -0400)]
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`?

8 years agoMake `Derivable` header be an h2 instead of an h1
Carol (Nichols || Goulding) [Sat, 21 May 2016 16:01:01 +0000 (12:01 -0400)]
Make `Derivable` header be an h2 instead of an h1

This matches the other subsections.

8 years ago`derive` explanation for PartialOrd should match that for Ord
Carol (Nichols || Goulding) [Sat, 21 May 2016 14:39:31 +0000 (10:39 -0400)]
`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

8 years agoAdd explanations about what derived trait implementations do
Carol (Nichols || Goulding) [Fri, 20 May 2016 19:50:34 +0000 (15:50 -0400)]
Add explanations about what derived trait implementations do

8 years agoAuto merge of #33098 - raphlinus:master, r=alexcrichton
bors [Mon, 23 May 2016 09:48:11 +0000 (02:48 -0700)]
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.

8 years agoAuto merge of #31457 - lambda:rtabort-use-libc-abort, r=alexcrichton
bors [Mon, 23 May 2016 06:14:11 +0000 (23:14 -0700)]
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

8 years agoUse libc::abort, not intrinsics::abort, in rtabort!
Brian Campbell [Sat, 6 Feb 2016 22:16:56 +0000 (17:16 -0500)]
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

8 years agoAuto merge of #33765 - alex-ozdemir:master, r=Manishearth
bors [Sun, 22 May 2016 06:58:57 +0000 (23:58 -0700)]
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.

8 years agoAuto merge of #33752 - mrhota:internal_docs, r=steveklabnik
bors [Sun, 22 May 2016 00:27:29 +0000 (17:27 -0700)]
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

8 years agoAuto merge of #33767 - sfackler:panic-hook-docs, r=alexcrichton
bors [Sat, 21 May 2016 17:17:40 +0000 (10:17 -0700)]
Auto merge of #33767 - sfackler:panic-hook-docs, r=alexcrichton

Mention that the panic hook will always run

r? @alexcrichton

cc @tomaka

8 years agoImprove internal documentation and code style
Ticki [Mon, 21 Dec 2015 21:24:15 +0000 (22:24 +0100)]
Improve internal documentation and code style

Fix some code layout, remove some unnecessary returns, fix typos,
punctuation, and comment consistency.

8 years agoAuto merge of #33768 - Manishearth:rollup, r=Manishearth
bors [Sat, 21 May 2016 07:38:55 +0000 (00:38 -0700)]
Auto merge of #33768 - Manishearth:rollup, r=Manishearth

Rollup of 7 pull requests

- Successful merges: #33578, #33679, #33743, #33746, #33747, #33750, #33757
- Failed merges:

8 years agoRollup merge of #33757 - GuillaumeGomez:simd, r=steveklabnik
Manish Goregaokar [Sat, 21 May 2016 03:38:11 +0000 (09:08 +0530)]
Rollup merge of #33757 - GuillaumeGomez:simd, r=steveklabnik

Update simd syntax

r? @steveklabnik

8 years agoRollup merge of #33750 - alx741:fix_typo, r=Manishearth
Manish Goregaokar [Sat, 21 May 2016 03:38:10 +0000 (09:08 +0530)]
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

8 years agoRollup merge of #33747 - postmodern:patch-2, r=Manishearth
Manish Goregaokar [Sat, 21 May 2016 03:38:10 +0000 (09:08 +0530)]
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 `?`.

8 years agoRollup merge of #33746 - dns2utf8:doc_sort_memory, r=steveklabnik
Manish Goregaokar [Sat, 21 May 2016 03:38:10 +0000 (09:08 +0530)]
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

8 years agoRollup merge of #33743 - royalstream:royalstream-stack-doc, r=steveklabnik
Manish Goregaokar [Sat, 21 May 2016 03:38:10 +0000 (09:08 +0530)]
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.

8 years agoRollup merge of #33679 - Manishearth:rustdoc-readmore-impls, r=alexcrichton
Manish Goregaokar [Sat, 21 May 2016 03:38:09 +0000 (09:08 +0530)]
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

8 years agoRollup merge of #33578 - durka:patch-21, r=alexcrichton
Manish Goregaokar [Sat, 21 May 2016 03:38:09 +0000 (09:08 +0530)]
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.

8 years agoAuto merge of #33625 - alexcrichton:rustbuild-moar-tests, r=aturon
bors [Sat, 21 May 2016 03:33:38 +0000 (20:33 -0700)]
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!

8 years agoAdded a `rustdoc` shortcut for collapse/expand all
Alex Ozdemir [Sat, 21 May 2016 02:21:35 +0000 (19:21 -0700)]
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.

8 years agoWording changes
Postmodern [Sat, 21 May 2016 00:47:34 +0000 (17:47 -0700)]
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".

8 years agoupdate tracking issue for once_poison
Alex Burka [Thu, 12 May 2016 01:01:29 +0000 (21:01 -0400)]
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.

8 years agoAuto merge of #33758 - GuillaumeGomez:rollup, r=Manishearth
bors [Fri, 20 May 2016 23:37:01 +0000 (16:37 -0700)]
Auto merge of #33758 - GuillaumeGomez:rollup, r=Manishearth

Rollup of 6 pull requests

- Successful merges: #33668, #33676, #33683, #33734, #33739, #33745
- Failed merges: #33578

8 years agorustc: Fix again order-dependence in extern crate
Alex Crichton [Fri, 20 May 2016 21:03:47 +0000 (14:03 -0700)]
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

8 years agoAuto merge of #33318 - alexcrichton:hashmap-seed, r=aturon
bors [Fri, 20 May 2016 19:39:00 +0000 (12:39 -0700)]
Auto merge of #33318 - alexcrichton:hashmap-seed, r=aturon

std: Cache HashMap keys in TLS

This is a rebase and extension of #31356 where we not only cache the keys in
thread local storage but we also bump each key every time a new `HashMap` is
created. This should give us a nice speed bost in creating hash maps along with
retaining the property that all maps have a nondeterministic iteration order.

Closes #27243

8 years agoAuto merge of #33378 - oli-obk:fix/registry_args, r=Manishearth
bors [Fri, 20 May 2016 15:44:01 +0000 (08:44 -0700)]
Auto merge of #33378 - oli-obk:fix/registry_args, r=Manishearth

fix Registry::args for plugins loaded with --extra-plugins

r? @Manishearth

8 years agoClarify docs for sort(&mut self)
Stefan Schindler [Thu, 19 May 2016 22:21:01 +0000 (00:21 +0200)]
Clarify docs for sort(&mut self)

8 years agoRollup merge of #33745 - postmodern:patch-1, r=steveklabnik
Guillaume Gomez [Fri, 20 May 2016 13:49:53 +0000 (15:49 +0200)]
Rollup merge of #33745 - postmodern:patch-1, r=steveklabnik

Clarify wording in `transmute` example

* Change "four eights" to "four u8s"
* Change "a 32" to "a u32"

8 years agoRollup merge of #33739 - GuillaumeGomez:error-code-tests, r=Manishearth
Guillaume Gomez [Fri, 20 May 2016 13:49:53 +0000 (15:49 +0200)]
Rollup merge of #33739 - GuillaumeGomez:error-code-tests, r=Manishearth

Add new error code tests

r? @steveklabnik

8 years agoRollup merge of #33734 - luqmana:33387-mir_fat_ptr_coerce, r=arielb1
Guillaume Gomez [Fri, 20 May 2016 13:49:53 +0000 (15:49 +0200)]
Rollup merge of #33734 - luqmana:33387-mir_fat_ptr_coerce, r=arielb1

[MIR] Add PointerCast for Unsize casts of fat pointers.

Fixes #33387.

r? @eddyb

8 years agoRollup merge of #33683 - sanxiyn:paren-span, r=nikomatsakis
Guillaume Gomez [Fri, 20 May 2016 13:49:52 +0000 (15:49 +0200)]
Rollup merge of #33683 - sanxiyn:paren-span, r=nikomatsakis

Preserve span when lowering ExprKind::Paren

Fix #33681.

8 years agoRollup merge of #33676 - rkruppe:e0509-exact-words, r=sanxiyn
Guillaume Gomez [Fri, 20 May 2016 13:49:52 +0000 (15:49 +0200)]
Rollup merge of #33676 - rkruppe:e0509-exact-words, r=sanxiyn

Reword the short diagnostic for E0509

Saying that a type *implements* a trait is much more idiomatic than saying it *defines* the trait.

8 years agoRollup merge of #33668 - dns2utf8:catch_thread, r=steveklabnik
Guillaume Gomez [Fri, 20 May 2016 13:49:52 +0000 (15:49 +0200)]
Rollup merge of #33668 - dns2utf8:catch_thread, r=steveklabnik

Catch thread in example

Since this is an example, the code will be copied by many people and should be over correct.

?r @steveklabnik

8 years agoUpdate simd syntax
ggomez [Fri, 20 May 2016 13:19:34 +0000 (15:19 +0200)]
Update simd syntax

8 years agoUpdate tests
Manish Goregaokar [Wed, 18 May 2016 18:37:58 +0000 (00:07 +0530)]
Update tests

8 years agoAuto merge of #33729 - alexcrichton:patch-libbacktrace, r=sfackler
bors [Fri, 20 May 2016 11:34:34 +0000 (04:34 -0700)]
Auto merge of #33729 - alexcrichton:patch-libbacktrace, r=sfackler

std: Backport a libbacktrace soundness fix

This is a backport of gcc-mirror/gcc@047a1c2f which is a soundness fix for when
a backtrace is generated on executables that do not have debug information.

8 years agoAuto merge of #33553 - alexcrichton:cdylibs, r=brson
bors [Fri, 20 May 2016 07:34:50 +0000 (00:34 -0700)]
Auto merge of #33553 - alexcrichton:cdylibs, r=brson

rustc: Add a new crate type, cdylib

This commit is an implementation of [RFC 1510] which adds a new crate type,
`cdylib`, to the compiler. This new crate type differs from the existing `dylib`
crate type in a few key ways:

* No metadata is present in the final artifact
* Symbol visibility rules are the same as executables, that is only reachable
  `extern` functions are visible symbols
* LTO is allowed
* All libraries are always linked statically

This commit is relatively simple by just plubming the compiler with another
crate type which takes different branches here and there. The only major change
is an implementation of the `Linker::export_symbols` function on Unix which now
actually does something. This helps restrict the public symbols from a cdylib on
Unix.

With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB,
which is some nice size savings!

[RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510

Closes #33132

8 years agoMention that the panic hook will always run
Steven Fackler [Fri, 20 May 2016 05:35:09 +0000 (22:35 -0700)]
Mention that the panic hook will always run

8 years agoAuto merge of #33358 - michaelwoerister:debuginfo-methods, r=eddyb
bors [Fri, 20 May 2016 03:40:44 +0000 (20:40 -0700)]
Auto merge of #33358 - michaelwoerister:debuginfo-methods, r=eddyb

debuginfo: Make DW_TAG_subroutine DIEs for inherent methods children of their self-type DIEs.

Fixes https://github.com/rust-lang/rust/issues/33192

8 years agobook: ownership: fix typo
Daniel Campoverde [alx741] [Fri, 20 May 2016 01:14:29 +0000 (20:14 -0500)]
book: ownership: fix typo

8 years agoGrammar change
Postmodern [Fri, 20 May 2016 00:27:04 +0000 (17:27 -0700)]
Grammar change

8 years agoKeep line-width within 80 columns
Postmodern [Fri, 20 May 2016 00:17:17 +0000 (17:17 -0700)]
Keep line-width within 80 columns

8 years agoClarify the English translation of `?Sized`
Postmodern [Fri, 20 May 2016 00:07:29 +0000 (17:07 -0700)]
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.

8 years agostd: Cache HashMap keys in TLS
Alex Crichton [Sun, 1 May 2016 18:21:04 +0000 (11:21 -0700)]
std: Cache HashMap keys in TLS

This is a rebase and extension of #31356 where we cache the keys in thread local
storage. This should give us a nice speed bost in creating hash maps along with
mostly retaining the property that all maps have a nondeterministic iteration
order.

Closes #27243

8 years agoAuto merge of #33103 - ranma42:escape-unicode-last, r=alexcrichton
bors [Thu, 19 May 2016 23:22:50 +0000 (16:22 -0700)]
Auto merge of #33103 - ranma42:escape-unicode-last, r=alexcrichton

Implement `last` for `EscapeUnicode`

The implementation is quite trivial as the last character is always `'{'`.
As a side-effect it also improves the implementation of `last` for `EscapeUnicode`.

Part of #24214, split from #31049.

Maybe this (and the other changes that I will split from #31049) should wait for a test like `ed_iterator_specializations` to be added. Would it be sufficient to do the same for each possible escape length?

8 years agodebuginfo: Make DW_TAG_subroutine DIEs for inherent methods children of their self...
Michael Woerister [Sun, 1 May 2016 16:46:55 +0000 (12:46 -0400)]
debuginfo: Make DW_TAG_subroutine DIEs for inherent methods children of their self-type DIEs.

8 years agoMark the metadata symbol as reachable to fix OSX not finding dylibs.
Eduard Burtescu [Mon, 16 May 2016 17:05:43 +0000 (20:05 +0300)]
Mark the metadata symbol as reachable to fix OSX not finding dylibs.

8 years agorustc: Add a new crate type, cdylib
Alex Crichton [Tue, 10 May 2016 21:17:57 +0000 (14:17 -0700)]
rustc: Add a new crate type, cdylib

This commit is an implementation of [RFC 1510] which adds a new crate type,
`cdylib`, to the compiler. This new crate type differs from the existing `dylib`
crate type in a few key ways:

* No metadata is present in the final artifact
* Symbol visibility rules are the same as executables, that is only reachable
  `extern` functions are visible symbols
* LTO is allowed
* All libraries are always linked statically

This commit is relatively simple by just plubming the compiler with another
crate type which takes different branches here and there. The only major change
is an implementation of the `Linker::export_symbols` function on Unix which now
actually does something. This helps restrict the public symbols from a cdylib on
Unix.

With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB,
which is some nice size savings!

[RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510

Closes #33132

8 years agoCatch thread in example
Stefan Schindler [Mon, 16 May 2016 16:54:12 +0000 (18:54 +0200)]
Catch thread in example

 - Consume result of thread join()
 - Add link to threading model

8 years agoClarify wording in `transmute` example
Postmodern [Thu, 19 May 2016 20:12:11 +0000 (13:12 -0700)]
Clarify wording in `transmute` example

* Change "four eights" to "four u8s"
* Change "a 32" to "a u32"

8 years agostd: Update libbacktrace for a soundness fix
Alex Crichton [Wed, 18 May 2016 23:59:06 +0000 (16:59 -0700)]
std: Update libbacktrace for a soundness fix

This updates the vendor'd libbacktrace source to tpick up
gcc-mirror/gcc@047a1c2f which is a soundness fix for when a backtrace is
generated on executables that do not have debug information.

8 years agoBook: small improvement to a table to make it clearer
Steven Burns [Thu, 19 May 2016 17:05:13 +0000 (11:05 -0600)]
Book: small improvement to a table to make it clearer

8 years agoAuto merge of #33742 - Manishearth:rollup, r=Manishearth
bors [Thu, 19 May 2016 16:45:53 +0000 (09:45 -0700)]
Auto merge of #33742 - Manishearth:rollup, r=Manishearth

Rollup of 10 pull requests

- Successful merges: #33353, #33611, #33696, #33698, #33705, #33708, #33712, #33720, #33721, #33730
- Failed merges:

8 years agoRollup merge of #33730 - jseyfried:fix_macro_backtrace_diagnostics, r=nikomatsakis
Manish Goregaokar [Thu, 19 May 2016 15:51:08 +0000 (21:21 +0530)]
Rollup merge of #33730 - jseyfried:fix_macro_backtrace_diagnostics, r=nikomatsakis

Fix macro expansion backtrace diagnostics

Fixes #33704.
r? @nikomatsakis

8 years agoRollup merge of #33721 - royalstream:royalstream-doc-highlights, r=Manishearth
Manish Goregaokar [Thu, 19 May 2016 15:51:07 +0000 (21:21 +0530)]
Rollup merge of #33721 - royalstream:royalstream-doc-highlights, r=Manishearth

Rust syntax coloring for some ignore, should-panic and no-run snippets.

In the book, some code blocks were missing the `rust` specifier which is needed for them to highlight correctly.

8 years agoRollup merge of #33720 - mark-summerfield:patch-1, r=steveklabnik
Manish Goregaokar [Thu, 19 May 2016 15:51:07 +0000 (21:21 +0530)]
Rollup merge of #33720 - mark-summerfield:patch-1, r=steveklabnik

Clarified that `let(mut x, y) =` only makes x mutable, not y

Closes #33716

8 years agoRollup merge of #33712 - jseyfried:fix_expanded_expr_span_bug, r=nrc
Manish Goregaokar [Thu, 19 May 2016 15:51:07 +0000 (21:21 +0530)]
Rollup merge of #33712 - jseyfried:fix_expanded_expr_span_bug, r=nrc

Fix bug in macro expression spans

Fix a bug in macro expression spans.
r? @nrc

8 years agoRollup merge of #33708 - nham:zero-elided-lifetimes, r=sanxiyn
Manish Goregaokar [Thu, 19 May 2016 15:51:06 +0000 (21:21 +0530)]
Rollup merge of #33708 - nham:zero-elided-lifetimes, r=sanxiyn

Only print parameters with elided lifetimes in elision error messages.

When displaying the function parameters for a lifetime elision error message,
this changes it to first filter out the parameters that don't have elided
lifetimes.

Fixes #30255.

8 years agoRollup merge of #33705 - lqd:rustdoc-version-tooltip, r=GuillaumeGomez
Manish Goregaokar [Thu, 19 May 2016 15:51:06 +0000 (21:21 +0530)]
Rollup merge of #33705 - lqd:rustdoc-version-tooltip, r=GuillaumeGomez

rustdoc: Make the #[stable(since)] version attribute clearer with a tooltip

Rustdoc's new 'since' version placement only shows the version number in which the item was marked stable. This gains space but might make the meaning of this version string less clear in the docs, so I tried to bring some explicitness in a tooltip.

8 years agoRollup merge of #33698 - alexcrichton:update-libc, r=japaric
Manish Goregaokar [Thu, 19 May 2016 15:51:06 +0000 (21:21 +0530)]
Rollup merge of #33698 - alexcrichton:update-libc, r=japaric

std: Update libc submodule

Brings in a fix where `-lutil` is no longer passed for musl targets, lifting the
need for a musl toolchain to be installed again.

Closes #33608

8 years agoRollup merge of #33696 - nham:add-test-21225, r=luqmana
Manish Goregaokar [Thu, 19 May 2016 15:51:05 +0000 (21:21 +0530)]
Rollup merge of #33696 - nham:add-test-21225, r=luqmana

Add regression tests for error message when using enum variant as a type

I'm guessing these were actually fixed with PR #27085.

Closes #21225
Closes #19197

8 years agoRollup merge of #33611 - vvanders:master, r=steveklabnik
Manish Goregaokar [Thu, 19 May 2016 15:51:05 +0000 (21:21 +0530)]
Rollup merge of #33611 - vvanders:master, r=steveklabnik

Add a note about Higher-Ranked Trait Bounds in docs on Closures.

I hit a snag with lifetimes a few days ago and it wasn't until @birkenfeld pointed out Higher-Ranked Trait Bounds that I was able to solve the issue involving lifetimes on closure traits. This adds a small section in the book so that other users can find it.

r? @steveklabnik

8 years agoRollup merge of #33353 - timothy-mcroy:E0502, r=sanxiyn
Manish Goregaokar [Thu, 19 May 2016 15:51:05 +0000 (21:21 +0530)]
Rollup merge of #33353 - timothy-mcroy:E0502, r=sanxiyn

Add error explanation for E0502

I am questioning the order of presentation on the suggested code fixes, but I'm not sure what would be best.  Thoughts?

r? @GuillaumeGomez

8 years agoAuto merge of #33702 - crimsun:pr33678, r=alexcrichton
bors [Thu, 19 May 2016 12:48:11 +0000 (05:48 -0700)]
Auto merge of #33702 - crimsun:pr33678, r=alexcrichton

Resolved rustdoc crash (#33678) by aborting instead of unwrapping.

Also removed Option use and comment to match.

Fixes https://github.com/rust-lang/rust/issues/33678

8 years agoAdd new error code tests
ggomez [Thu, 19 May 2016 12:00:43 +0000 (14:00 +0200)]
Add new error code tests

8 years agoMake the #[stable(since)] version attribute clearer with a tooltip
Rémy Rakic [Wed, 18 May 2016 01:54:52 +0000 (03:54 +0200)]
Make the #[stable(since)] version attribute clearer with a tooltip

8 years agoReword the short diagnostic for E0509
Robin Kruppe [Mon, 16 May 2016 22:40:27 +0000 (00:40 +0200)]
Reword the short diagnostic for E0509

Saying that a type *implements* a trait is much more idiomatic than saying it *defines* the trait.

8 years agoAuto merge of #33694 - arielb1:fuzzy-on-unimplemented, r=nikomatsakis
bors [Thu, 19 May 2016 08:50:53 +0000 (01:50 -0700)]
Auto merge of #33694 - arielb1:fuzzy-on-unimplemented, r=nikomatsakis

implement fuzzy matching in on_unimplemented

Fixes #31062

r? @nikomatsakis

8 years ago[MIR] Add PointerCast for Unsize casts of fat pointers.
Luqman Aden [Thu, 19 May 2016 02:25:03 +0000 (22:25 -0400)]
[MIR] Add PointerCast for Unsize casts of fat pointers.

8 years agoAuto merge of #33688 - jonathandturner:fix_old_school, r=nikomatsakis
bors [Thu, 19 May 2016 04:19:07 +0000 (21:19 -0700)]
Auto merge of #33688 - jonathandturner:fix_old_school, r=nikomatsakis

Fix for old school error issues, improvements to new school

This PR:
* Fixes some old school error issues, specifically #33559, #33543, #33366
* Improves wording borrowck errors with match patterns
* De-emphasize multi-line spans, so we don't color the single source character when we're trying to say "span starts here"
* Rollup of #33392 (which should help fix #33390)

r? @nikomatsakis

8 years agoFix macro expansion backtrace diagnostics
Jeffrey Seyfried [Thu, 19 May 2016 00:19:57 +0000 (00:19 +0000)]
Fix macro expansion backtrace diagnostics

8 years agorustbuild: Pass -O to tests based on configuration
Alex Crichton [Fri, 13 May 2016 22:26:41 +0000 (15:26 -0700)]
rustbuild: Pass -O to tests based on configuration

Currently rustbuild isn't detecting the `-O` flag for tests via the
`--disable-optimize-tests` or not command line flag to `./configure`, and this
commit patches up the support to pass `-O` by default.

8 years agorustbuild: Add missing test suites
Alex Crichton [Fri, 13 May 2016 22:11:42 +0000 (15:11 -0700)]
rustbuild: Add missing test suites

After a comparison with the current set of tests run it was discovered that
rustbuild accidentally wasn't running a few test suites. This commit adds back a
few more test suites:

* rfail-full
* pretty-rpass
* pretty-rpass-full
* pretty-rpass-valgrind
* pretty-rfail
* pretty-rfail-full
* librustc_bitflags unit tests

8 years agoAuto merge of #33686 - GuillaumeGomez:error-code-tests, r=steveklabnik
bors [Wed, 18 May 2016 22:12:56 +0000 (15:12 -0700)]
Auto merge of #33686 - GuillaumeGomez:error-code-tests, r=steveklabnik

Add new error code tests

r? @steveklabnik

8 years agoaddress review comments
Ariel Ben-Yehuda [Wed, 18 May 2016 20:28:31 +0000 (23:28 +0300)]
address review comments

8 years agoMove read more link to same line
Manish Goregaokar [Wed, 18 May 2016 18:27:13 +0000 (23:57 +0530)]
Move read more link to same line

8 years agoSimplify report_elision_failure a little bit.
Nick Hamann [Wed, 18 May 2016 18:09:25 +0000 (13:09 -0500)]
Simplify report_elision_failure a little bit.

8 years agoRust syntax coloring for some ignore, should-panic and no-run snippets.
Steven Burns [Wed, 18 May 2016 17:30:50 +0000 (11:30 -0600)]
Rust syntax coloring for some ignore, should-panic and no-run snippets.

8 years agoClarified that `let(mut x, y) =` only makes x mutable, not y
mark-summerfield [Wed, 18 May 2016 16:43:22 +0000 (17:43 +0100)]
Clarified that `let(mut x, y) =` only makes x mutable, not y

8 years agorustdoc: Support short doc fallback for non-default items
Manish Goregaokar [Tue, 17 May 2016 02:01:16 +0000 (07:31 +0530)]
rustdoc: Support short doc fallback for non-default items

8 years agorustdoc: Add doc snippets for trait impls, with a read more link
Manish Goregaokar [Tue, 17 May 2016 01:20:39 +0000 (06:50 +0530)]
rustdoc: Add doc snippets for trait impls, with a read more link

Fixes #33672

8 years agoimplement fuzzy matching in on_unimplemented
Ariel Ben-Yehuda [Tue, 17 May 2016 18:55:34 +0000 (21:55 +0300)]
implement fuzzy matching in on_unimplemented

8 years agoAuto merge of #33476 - nikomatsakis:incr-comp-xcrate, r=mw
bors [Wed, 18 May 2016 15:47:53 +0000 (08:47 -0700)]
Auto merge of #33476 - nikomatsakis:incr-comp-xcrate, r=mw

track incr. comp. dependencies across crates

This PR refactors the compiler's incremental compilation hashing so that it can track dependencies across crates. The main bits are:

- computing a hash representing the metadata for an item we are emitting
  - we do this by making `MetaData(X)` be the current task while computing metadata for an item
  - this naturally registers reads from any tables and things that we read for that purpose
  - we can then hash all the inputs to those tables
- tracking when we access metadata
  - we do this by registering a read of `MetaData(X)` for each foreign item `X` whose metadata we read
- hashing metadata from foreign items
  - we do this by loading up metadata from a file in the incr. comp. directory
  - if there is no file, we use the SVH for the entire crate

There is one very simple test only at this point. The next PR will be focused on expanding out the tests.

Note that this is based on top of https://github.com/rust-lang/rust/pull/33228

r? @michaelwoerister

8 years agoBe smart about span of parenthesized expression in macro
Seo Sanghyeon [Wed, 18 May 2016 15:03:00 +0000 (00:03 +0900)]
Be smart about span of parenthesized expression in macro

8 years agoadd task for linking
Niko Matsakis [Wed, 18 May 2016 13:23:40 +0000 (09:23 -0400)]
add task for linking

In MSVC (at least), linking requires accessing metadata, which generates
reads.

8 years agofix indentation of session/mod.rs
Niko Matsakis [Fri, 13 May 2016 22:48:54 +0000 (18:48 -0400)]
fix indentation of session/mod.rs

8 years agoadd debug info to dep_graph
Niko Matsakis [Fri, 13 May 2016 22:48:46 +0000 (18:48 -0400)]
add debug info to dep_graph

8 years agonit: cache crate-hash for next time
Niko Matsakis [Thu, 12 May 2016 15:37:08 +0000 (11:37 -0400)]
nit: cache crate-hash for next time

8 years agonit: use format! instead of iterator
Niko Matsakis [Thu, 12 May 2016 14:12:58 +0000 (10:12 -0400)]
nit: use format! instead of iterator

8 years agobasic tests for cross-crate hashing
Niko Matsakis [Fri, 6 May 2016 19:17:55 +0000 (15:17 -0400)]
basic tests for cross-crate hashing

8 years agoload/save hashes of metadata
Niko Matsakis [Fri, 6 May 2016 19:09:31 +0000 (15:09 -0400)]
load/save hashes of metadata

This commit reorganizes how the persist code treats hashing. The idea is
that each crate saves a file containing hashes representing the metadata
for each item X. When we see a read from `MetaData(X)`, we can load this
hash up (if we don't find a file for that crate, we just use the SVH for
the entire crate).

To compute the hash for `MetaData(Y)`, where Y is some local item, we
examine all the predecessors of the `MetaData(Y)` node and hash their
hashes together.

8 years agoallow retracing paths across crates
Niko Matsakis [Fri, 6 May 2016 18:52:57 +0000 (14:52 -0400)]
allow retracing paths across crates

For external crates, we must build up a map that goes from
the DefKey to the DefIndex. We do this by iterating over each
index that is found in the metadata and loading the associated
DefKey.

8 years agocleanup dep-graph debugging code
Niko Matsakis [Fri, 6 May 2016 09:02:05 +0000 (05:02 -0400)]
cleanup dep-graph debugging code

Create some re-usable filtering subroutines.

8 years agochange svh to store a u64
Niko Matsakis [Fri, 6 May 2016 09:01:09 +0000 (05:01 -0400)]
change svh to store a u64

We used to store a u64 converted to a String for some reason. Now we
don't.

8 years agopass revision and incr_comp directory to auxbuild
Niko Matsakis [Thu, 5 May 2016 00:44:22 +0000 (20:44 -0400)]
pass revision and incr_comp directory to auxbuild

This is needed for incremental compilation harness to support
cross-crate testing. Also support cfg for typechecking prettyprint

8 years agoalways encode variant fields
Niko Matsakis [Fri, 22 Apr 2016 19:18:02 +0000 (15:18 -0400)]
always encode variant fields

we need them to be able to retrace.

8 years agomake the filename computation take a cratenum
Niko Matsakis [Wed, 6 Apr 2016 21:54:40 +0000 (17:54 -0400)]
make the filename computation take a cratenum