Commit Graph

53497 Commits

Author SHA1 Message Date
Simonas Kazlauskas
ed4688c232 Fix the test to use explicit argument types
Hopefully this pacifies the 32bit windows. Apparently there’s an ABI out there that not only allows
non-64 bit variadic arguments, but also has differing ABI for them!

Good thing all variadic functions are unsafe.
2016-06-02 20:09:59 +03:00
Simonas Kazlauskas
f18118702f Rewrite variadic-ffi pass to use test helper
The sprintf used in this test previously isn’t available on some versions of MSVC.

Fixes #32305
2016-05-27 03:05:52 +03:00
bors
da66f2fd8c Auto merge of #33713 - LeoTestard:macro-rules-invalid-lhs, r=pnkfelix
Make sure that macros that didn't pass LHS checking are not expanded.

This avoid duplicate errors for things like invalid fragment specifiers, or
parsing errors for ambiguous macros.
2016-05-25 09:40:06 -07:00
bors
5229e0efb3 Auto merge of #33602 - eddyb:no-trans--check, r=michaelwoerister
Save metadata even with -Z no-trans (e.g. for multi-crate cargo check).

Removes the item symbol map in metadata, as we can now generate them in a deterministic manner.
The `-Z no-trans` change lets the LLVM passes and linking run, but with just metadata and no code.
It fails while trying to link a binary because there's no `main` function, which is correct but not good UX.

There's also no way to easily throw away all of the artifacts to rebuild with actual code generation.
We might want `cargo check` to do that using cargo-internal information and then it would just work.

cc @alexcrichton @nikomatsakis @Aatch @michaelwoerister
2016-05-25 02:33:29 -07:00
Eduard Burtescu
a619901e3d trans: save metadata even with -Z no-trans. 2016-05-25 08:46:36 +03:00
bors
487de42083 Auto merge of #33615 - GuillaumeGomez:field_static_method, r=pnkfelix
Don't suggest using fields in a static method

Fixes #33613.

cc @LeoTestard
2016-05-24 21:52:02 -07:00
Eduard Burtescu
04464db954 trans: remove item_symbols from metadata and CrateContext. 2016-05-25 01:56:49 +03:00
Eduard Burtescu
b03bde9c2a trans: move the linker support to compute symbols on-demand. 2016-05-25 01:45:25 +03:00
Eduard Burtescu
c9a10bd26b trans: move exported_symbol to Instance::symbol_name. 2016-05-25 01:34:20 +03:00
Eduard Burtescu
a6a5e4884a trans: force absolute item paths within symbols. 2016-05-25 01:34:20 +03:00
Eduard Burtescu
14133d33bc trans: move exported_name's logic into symbol_names. 2016-05-25 01:34:17 +03:00
Eduard Burtescu
39184741bc trans: remove unused symbol_names::exported_name_with_suffix. 2016-05-25 01:20:55 +03:00
Eduard Burtescu
7462da5c38 rustc: use a simpler scheme for plugin registrar symbol names. 2016-05-25 01:20:55 +03:00
bors
8393d99c35 Auto merge of #33833 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #33692, #33759, #33779, #33781, #33797, #33810, #33832
- Failed merges:
2016-05-24 10:39:00 -07:00
Guillaume Gomez
46138352e6 Rollup merge of #33810 - tmr232:patch-1, r=Manishearth
Fixed link in Rust Book (no-stdlib)

Closes #33806
2016-05-24 12:58:19 +02:00
Guillaume Gomez
1e4a77bef2 Rollup merge of #33797 - alex-ozdemir:rustdoc, r=GuillaumeGomez
Changed toggle all sections key to `T`

Allows both `T` and `t`.

It had been [Shift]+[+] before.

In response to #33791.

cc @Manishearth
r? @GuillaumeGomez
2016-05-24 12:58:18 +02:00
Guillaume Gomez
5e0d493097 Rollup merge of #33781 - GuillaumeGomez:err-codes, r=steveklabnik
Add new error code tests

r? @steveklabnik
2016-05-24 12:58:18 +02:00
Guillaume Gomez
94b16f123f Rollup merge of #33779 - GuillaumeGomez:repr-simd, r=steveklabnik
Update repr_simd

r? @steveklabnik
2016-05-24 12:58:17 +02:00
Guillaume Gomez
66faadaf33 Rollup merge of #33759 - aakloxu:patch-2, r=steveklabnik
Fix references links

There are duplicate link references in the article and just remove one of them.
2016-05-24 12:58:17 +02:00
Guillaume Gomez
890c3f9641 Rollup merge of #33692 - nham:fix_E0207, r=GuillaumeGomez
Improve the long explanation of E0207.

The previous explanation does not seem to explain what it means for an
implementation parameter to be used or unused. The new explanation lists
the three ways specific ways by which an impl parameter becomes constrained
(taken from RFC 447).

This also adds a link to RFC 447.

The explanation has two different examples. The first is adapted from RFC 447,
and shows an instance of E0207 on a impl for a type. The second one is a trait
impl example adapted from issue #22834.

Closes #33650

cc #32777

r? @GuillaumeGomez
2016-05-24 12:58:17 +02:00
Leo Testard
7d521445fd Avoid iterating two times over the list of LHSes. 2016-05-24 11:21:37 +02:00
Leo Testard
eb364e9c29 Make sure that macros that didn't pass LHS checking are not expanded.
This avoids duplicate errors for things like invalid fragment specifiers, or
parsing errors for ambiguous macros. Fixes #29231.
2016-05-24 11:21:28 +02:00
bors
dd6e8d45e1 Auto merge of #33787 - cuviper:local-rebuild, r=alexcrichton
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.  Both the makefiles and rustbuild support this configuration.

Fixes #29556
r? @alexcrichton
2016-05-23 20:02:23 -07:00
bors
57ef015132 Auto merge of #33664 - huonw:abs_sub, r=alexcrichton
Deprecate {f32,f64}::abs_sub.

The abs_sub name is misleading: the function actually computes the
positive difference (`fdim` in C), not the `(x - y).abs()` that *many* people expect
from the name.

This function can be replaced with just `(x - y).max(0.0)`, mirroring
the `abs` version, but this behaves differently with NAN: `NAN.max(0.0)
== 0.0`, while `NAN.positive_diff(0.0) == NAN`. People who absolutely
need that behaviour can use the C function directly and/or talk to the libs
team (we haven't encountered a concrete use-case for this functionality).

Closes #30315.
2016-05-23 13:31:59 -07:00
Nick Hamann
7d78436359 Improve the long explanation of E0207.
The previous explanation does not seem to explain what it means for an
implementation parameter to be used or unused. The new explanation lists
the three ways specific ways by which an impl parameter becomes constrained
(taken from RFC 447).

This also adds a link to RFC 447.

The explanation has two different examples. The first is adapted from RFC 447,
and shows an instance of E0207 on a impl for a type. The second one is a trait
impl example adapted from issue #22834.

Closes #33650
2016-05-23 13:18:28 -05:00
Josh Stone
0ca7d3dc1f bootstrap: rename Config.rebuild to .local_rebuild 2016-05-23 09:49:46 -07:00
bors
1ccada6cd3 Auto merge of #33735 - jseyfried:concat_idents_in_ty_positions, r=nrc
Allow `concat_idents!` in type positions as well as in expression positions

This allows the `concat_idents!` macro in type positions as well as in expression positions.
r? @nrc
2016-05-23 07:53:43 -07: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
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
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
ggomez
62e387102a Add new error code tests 2016-05-22 19:26:21 +02: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
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