Commit Graph

53430 Commits

Author SHA1 Message Date
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
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
bors
179539f6eb 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
2016-05-20 12:39:00 -07:00
bors
0352866da7 Auto merge of #33378 - oli-obk:fix/registry_args, r=Manishearth
fix Registry::args for plugins loaded with --extra-plugins

r? @Manishearth
2016-05-20 08:44:01 -07:00
Guillaume Gomez
4a3ba87d82 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"
2016-05-20 15:49:53 +02:00
Guillaume Gomez
c67dae8f6d Rollup merge of #33739 - GuillaumeGomez:error-code-tests, r=Manishearth
Add new error code tests

r? @steveklabnik
2016-05-20 15:49:53 +02:00
Guillaume Gomez
4913e88c00 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
2016-05-20 15:49:53 +02:00
Guillaume Gomez
5dc8dfa86f Rollup merge of #33683 - sanxiyn:paren-span, r=nikomatsakis
Preserve span when lowering ExprKind::Paren

Fix #33681.
2016-05-20 15:49:52 +02:00
Guillaume Gomez
f22c5aab1e 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.
2016-05-20 15:49:52 +02:00
Guillaume Gomez
fda31345c1 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
2016-05-20 15:49:52 +02:00
Manish Goregaokar
9ce018bafb
Update tests 2016-05-20 17:44:31 +05:30
bors
55cabda8d5 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.
2016-05-20 04:34:34 -07:00
bors
d27bdafc3e 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
2016-05-20 00:34:50 -07:00
bors
cde0fa5f67 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
2016-05-19 20:40:44 -07:00
Alex Crichton
eaeef3db0e 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
2016-05-19 16:58:15 -07:00
bors
1ec80f65fb 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?
2016-05-19 16:22:50 -07:00
Michael Woerister
499605c651 debuginfo: Make DW_TAG_subroutine DIEs for inherent methods children of their self-type DIEs. 2016-05-19 19:09:49 -04:00
Eduard Burtescu
0d2c26c261 Mark the metadata symbol as reachable to fix OSX not finding dylibs. 2016-05-19 15:32:03 -07:00
Alex Crichton
07d373f3d6 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
2016-05-19 15:32:03 -07:00
Stefan Schindler
22615adf02 Catch thread in example
- Consume result of thread join()
 - Add link to threading model
2016-05-19 23:05:08 +02:00
Postmodern
345626f088 Clarify wording in transmute example
* Change "four eights" to "four u8s"
* Change "a 32" to "a u32"
2016-05-19 13:12:11 -07:00
Alex Crichton
a42115375b 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.
2016-05-19 11:56:43 -07:00
Steven Burns
519cc8280c Book: small improvement to a table to make it clearer 2016-05-19 11:05:13 -06:00
bors
764ef92ae7 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:
2016-05-19 09:45:53 -07:00
Manish Goregaokar
acd2c11c5e Rollup merge of #33730 - jseyfried:fix_macro_backtrace_diagnostics, r=nikomatsakis
Fix macro expansion backtrace diagnostics

Fixes #33704.
r? @nikomatsakis
2016-05-19 21:21:08 +05:30
Manish Goregaokar
5928d49aa0 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.
2016-05-19 21:21:07 +05:30
Manish Goregaokar
f6f5cdfcec Rollup merge of #33720 - mark-summerfield:patch-1, r=steveklabnik
Clarified that `let(mut x, y) =` only makes x mutable, not y

Closes #33716
2016-05-19 21:21:07 +05:30
Manish Goregaokar
8b4b3a8b09 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
2016-05-19 21:21:07 +05:30
Manish Goregaokar
14661aeb0a 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.
2016-05-19 21:21:06 +05:30
Manish Goregaokar
355d9f98f5 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.
2016-05-19 21:21:06 +05:30
Manish Goregaokar
26f666b7ad 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
2016-05-19 21:21:06 +05:30
Manish Goregaokar
7acb22ab54 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
2016-05-19 21:21:05 +05:30
Manish Goregaokar
e4f33d5ae7 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
2016-05-19 21:21:05 +05:30
Manish Goregaokar
c9ca735a7b 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
2016-05-19 21:21:05 +05:30
bors
2fb6f8e2c9 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
2016-05-19 05:48:11 -07:00
ggomez
93fb14ff42 Add new error code tests 2016-05-19 14:00:43 +02:00
Rémy Rakic
352a70b3a0 Make the #[stable(since)] version attribute clearer with a tooltip 2016-05-19 13:44:09 +02:00
Robin Kruppe
e575d19acc Reword the short diagnostic for E0509
Saying that a type *implements* a trait is much more idiomatic than saying it *defines* the trait.
2016-05-19 11:02:41 +02:00
bors
d0ca0ca063 Auto merge of #33694 - arielb1:fuzzy-on-unimplemented, r=nikomatsakis
implement fuzzy matching in on_unimplemented

Fixes #31062

r? @nikomatsakis
2016-05-19 01:50:53 -07:00
Luqman Aden
94f0918c19 [MIR] Add PointerCast for Unsize casts of fat pointers. 2016-05-19 02:42:24 -04:00
bors
0c5d651d0b 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
2016-05-18 21:19:07 -07:00
Jeffrey Seyfried
f8e9c15027 Fix macro expansion backtrace diagnostics 2016-05-19 00:24:43 +00:00
bors
9c6904ca1e Auto merge of #33686 - GuillaumeGomez:error-code-tests, r=steveklabnik
Add new error code tests

r? @steveklabnik
2016-05-18 15:12:56 -07:00
Ariel Ben-Yehuda
b9a201c6df address review comments 2016-05-18 23:28:31 +03:00
Manish Goregaokar
74633b08e0 Move read more link to same line 2016-05-18 23:57:13 +05:30
Nick Hamann
a50c82bc3b Simplify report_elision_failure a little bit. 2016-05-18 13:09:25 -05:00
Steven Burns
c9517189d7 Rust syntax coloring for some ignore, should-panic and no-run snippets. 2016-05-18 11:30:50 -06:00