Commit Graph

60222 Commits

Author SHA1 Message Date
bors
e7907a9910 Auto merge of #38793 - jseyfried:fix_macro_export_duplicates, r=nrc
Fix regression with duplicate `#[macro_export] macro_rules!`

Fixes #38715.
r? @nrc
2017-01-06 06:41:31 +00:00
bors
6f1ae663ef Auto merge of #38069 - canndrew:empty-sub-patterns-again, r=nikomatsakis
Fix handling of empty types in patterns.

Fix for #12609.
2017-01-06 00:17:41 +00:00
bors
42bed72385 Auto merge of #38689 - pnkfelix:dont-check-stability-on-private-items, r=nikomatsakis
Dont check stability for items that are not pub to universe.

Dont check stability for items that are not pub to universe.

In other words, skip it for private and even `pub(restricted)` items, because stability checks are only relevant to things visible in other crates.

Fix #38412.
2017-01-05 21:58:45 +00:00
bors
ea2d41e31f Auto merge of #38817 - jseyfried:improve_unused_qualification_lint, r=petrochenkov
resolve: don't `unused_qualifications`-check global paths

We started `unused_qualifications`-checking global paths in #38014, causing #38682.
Fixes #38682.
r? @nrc
2017-01-05 19:56:31 +00:00
Andrew Cann
275c19d5b6 fix doc test for E0001 2017-01-06 01:00:03 +08:00
Andrew Cann
291c84aad4 Un-remove E0001, put a notice on it instead 2017-01-05 23:48:02 +08:00
bors
74e5b7d96a Auto merge of #38152 - arielb1:special-copy, r=nikomatsakis
Fix associated types in copy implementations

Fixes an ICE and an error in checking copy implementations.

r? @nikomatsakis
2017-01-05 13:05:30 +00:00
bors
2f56207b12 Auto merge of #38776 - eddyb:unsigned-means-unsigned, r=pnkfelix
Properly ban the negation of unsigned integers in type-checking.

Lint-time banning of unsigned negation appears to be vestigial from a time it was feature-gated.
But now it always errors and we do have the ability to deref the checking of e.g. `-0`, through the trait obligation fulfillment context, which will only succeed/error when the `0` gets inferred to a specific type.

The two removed tests are the main reason for finally cleaning this up, they need changing all the time when refactoring the HIR-based `rustc_const_eval` and/or `rustc_passes::consts`, as warnings pile up.
2017-01-05 11:06:10 +00:00
bors
26e2ee00f9 Auto merge of #38767 - est31:master, r=eddyb
Some i128 tests

* Add some FFI tests for i128 on architectures where we have sort of working "C" FFI support. On all other architectures we ignore the test.
* enhance the u128 overflow tests
2017-01-05 09:02:40 +00:00
bors
5dd07b66ff Auto merge of #38756 - Mark-Simulacrum:2nd-trans-cleanup, r=eddyb
Additional cleanup to rustc_trans

Removes `BlockAndBuilder`, `FunctionContext`, and `MaybeSizedValue`.

`LvalueRef` is used instead of `MaybeSizedValue`, which has the added benefit of making functions operating on `Lvalue`s be able to take just that (since it encodes the type with an `LvalueTy`, which can carry discriminant information) instead of a `MaybeSizedValue` and a discriminant.

r? @eddyb
2017-01-05 06:01:24 +00:00
bors
80745e2a23 Auto merge of #38731 - alexcrichton:supafast-cross-dist, r=brson
rustbuild: Quickly `dist` cross-host compilers

This commit optimizes the compile time for creating tarballs of cross-host
compilers and as a proof of concept adds two to the standard Travis matrix. Much
of this commit is further refactoring and refining of the `step.rs` definitions
along with the interpretation of `--target` and `--host` flags. This has gotten
confusing enough that I've also added a small test suite to
`src/bootstrap/step.rs` to ensure what we're doing works and doesn't regress.

After this commit when you execute:

    ./x.py dist --host $MY_HOST --target $MY_HOST

the build system will compile two compilers. The first is for the build platform
and the second is for the host platform. This second compiler is then packaged
up and placed into `build/dist` and is ready to go. With a fully cached LLVM and
docker image I was able to create a cross-host compiler in around 20 minutes
locally.

Eventually we plan to add a whole litany of cross-host entries to the Travis
matrix, but for now we're just adding a few before we eat up all the extra
capacity.

cc #38531
2017-01-05 04:01:35 +00:00
bors
5d994d8b7e Auto merge of #38770 - steveklabnik:doc-custom-derive, r=alexcrichton
Document custom derive.

These are some bare-bones documentation for custom derive, needed
to stabilize "macros 1.1",
https://github.com/rust-lang/rust/issues/35900

The book chapter is based off of a blog post by @cbreeden,
https://cbreeden.github.io/Macros11/

Normally, we have a policy of not mentioning external crates in
documentation. However, given that syn/quote are basically neccesary
for properly using macros 1.1, I feel that not including them here
would make the documentation very bad. So the rules should be bent
in this instance.

So far, this PR includes only docs; @alexcrichton said in https://github.com/rust-lang/rust/issues/35900 that he'd be okay with landing them before stabilization; I don't mind either way.
2017-01-05 00:11:37 +00:00
Steve Klabnik
3075c1f65e Document custom derive.
These are some bare-bones documentation for custom derive, needed
to stabilize "macros 1.1",
https://github.com/rust-lang/rust/issues/35900

The book chapter is based off of a blog post by @cbreeden,
https://cbreeden.github.io/Macros11/

Normally, we have a policy of not mentioning external crates in
documentation. However, given that syn/quote are basically neccesary
for properly using macros 1.1, I feel that not including them here
would make the documentation very bad. So the rules should be bent
in this instance.
2017-01-04 17:34:30 -05:00
bors
95b14a3b50 Auto merge of #38783 - alexcrichton:stabilize-proc-macro, r=nikomatsakis
rustc: Stabilize the `proc_macro` feature

This commit stabilizes the `proc_macro` and `proc_macro_lib` features in the
compiler to stabilize the "Macros 1.1" feature of the language. Many more
details can be found on the tracking issue, #35900.

Closes #35900
2017-01-04 20:06:21 +00:00
Alex Crichton
1a040b36cb rustbuild: Quickly dist cross-host compilers
This commit optimizes the compile time for creating tarballs of cross-host
compilers and as a proof of concept adds two to the standard Travis matrix. Much
of this commit is further refactoring and refining of the `step.rs` definitions
along with the interpretation of `--target` and `--host` flags. This has gotten
confusing enough that I've also added a small test suite to
`src/bootstrap/step.rs` to ensure what we're doing works and doesn't regress.

After this commit when you execute:

    ./x.py dist --host $MY_HOST --target $MY_HOST

the build system will compile two compilers. The first is for the build platform
and the second is for the host platform. This second compiler is then packaged
up and placed into `build/dist` and is ready to go. With a fully cached LLVM and
docker image I was able to create a cross-host compiler in around 20 minutes
locally.

Eventually we plan to add a whole litany of cross-host entries to the Travis
matrix, but for now we're just adding a few before we eat up all the extra
capacity.

cc #38531
2017-01-04 11:41:16 -08:00
Mark Simulacrum
b01b6e1d56 Fix errors introduced during rebase 2017-01-04 11:47:43 -07:00
Mark Simulacrum
21f86ba1bc Simplify handling of dropping structs. 2017-01-04 11:38:11 -07:00
Mark Simulacrum
7dadd14d6c Pull out downcasting into caller of iter_variant
Renames iter_variant to iter_variant_fields to more clearly communicate
the purpose of the function.
2017-01-04 11:38:11 -07:00
Mark Simulacrum
d25fc9ec5f Remove extraneous setting of builder positions. 2017-01-04 11:38:11 -07:00
Mark Simulacrum
ca328e1bb4 Simplify code further 2017-01-04 11:38:11 -07:00
Mark Simulacrum
c3fe2590f5 Inline and remove Builder::entry_block 2017-01-04 11:38:10 -07:00
Mark Simulacrum
ba37c91831 Fix style nit 2017-01-04 11:38:10 -07:00
Mark Simulacrum
901984e1d1 Builder.build_new_block -> Builder.build_sibling_block 2017-01-04 11:38:10 -07:00
Mark Simulacrum
81e8137b0d Inline trans_switch to simplify code 2017-01-04 11:38:10 -07:00
Mark Simulacrum
426c558c5a Move trans_field_ptr and struct_field_ptr to mir/lvalue 2017-01-04 11:38:09 -07:00
Mark Simulacrum
982b8f4f49 Move trans_const to mir::constant 2017-01-04 11:37:44 -07:00
Mark Simulacrum
ea0ebe41c7 Change trans_field_ptr to utilize LvalueTy to determine discriminant. 2017-01-04 11:37:42 -07:00
Mark Simulacrum
8038489357 Use LvalueRef instead of MaybeSizedValue 2017-01-04 11:35:33 -07:00
Mark Simulacrum
4c9995a3f9 Simpliy block creation in MirContext 2017-01-04 11:34:27 -07:00
Mark Simulacrum
37dd9f6c7b Add Builder::sess and Builder::tcx methods 2017-01-04 11:34:26 -07:00
Mark Simulacrum
f67e7d6b4a Add method, new_block, to MirContext for block construction.
This makes a slow transition to block construction happening only from
MirContext easier.
2017-01-04 11:34:00 -07:00
Mark Simulacrum
937e8da349 Purge FunctionContext 2017-01-04 11:33:59 -07:00
Mark Simulacrum
1be170b01a Replace BlockAndBuilder with Builder. 2017-01-04 11:33:31 -07:00
est31
28f6d4a637 Add test for i128 ffi usage 2017-01-04 19:05:27 +01:00
est31
1fefa3cc91 enhance u128 overflow tests 2017-01-04 19:00:38 +01:00
bors
05f4a75eba Auto merge of #38414 - estebank:doc-dissambiguate, r=steveklabnik
Rustdoc: disambiguate Implementors when the type name is not unique

Presentation [goes from](https://doc.rust-lang.org/stable/std/iter/trait.ExactSizeIterator.html#implementors):

<img width="492" alt="" src="https://cloud.githubusercontent.com/assets/1606434/21276752/b2b50474-c387-11e6-96e1-9766851da269.png">

to:

<img width="787" alt="" src="https://cloud.githubusercontent.com/assets/1606434/21276763/bb37f6b0-c387-11e6-8596-9163cb254674.png">

on cases where there're multiple implementors with the same name.

Fixes #37762.
2017-01-04 17:11:02 +00:00
bors
d40d01bd0e Auto merge of #38670 - dotdash:transmute_align, r=eddyb
Fix transmute::<T, U> where T requires a bigger alignment than U

For transmute::<T, U> we simply pointercast the destination from a U
pointer to a T pointer, without providing any alignment information,
thus LLVM assumes that the destination is aligned to hold a value of
type T, which is not necessarily true. This can lead to LLVM emitting
machine instructions that assume said alignment, and thus cause aborts.

To fix this, we need to provide the actual alignment to store_operand()
and in turn to store() so they can set the proper alignment information
on the stores and LLVM can emit the proper machine instructions.

Fixes #32947
2017-01-04 14:26:17 +00:00
Ariel Ben-Yehuda
5fad51e7f4 typeck::coherence::builtin - sort impls in the DefId order
this makes error messages consistent across architectures
2017-01-04 11:54:57 +02:00
bors
9c0e373f91 Auto merge of #38773 - sanxiyn:rustdoc-ice, r=steveklabnik
Avoid rustdoc ICE when an unstable feature is used

Fix #36159.
2017-01-04 09:24:24 +00:00
Jeffrey Seyfried
927408d9c5 Fix regression with duplicate #[macro_export] macro_rules!. 2017-01-04 08:03:23 +00:00
bors
e06ce71d0b Auto merge of #38552 - eddyb:bad-blocks, r=arielb1
Don't leak the compiler's internal representation of scopes in error messages.

Fixes #37884 (actually fixes #27942, which was made worse by #37412) by handling more node types.
Ideally we'd turn the unknown node type situations into ICEs and fix them as they show up in errors.
But we might want to backport this patch so I was less aggressive.
2017-01-04 06:29:14 +00:00
Jeffrey Seyfried
7dcacf15b9 Don't unused_qualifications-check global paths. 2017-01-04 06:19:58 +00:00
bors
01677eeef2 Auto merge of #38707 - redox-os:master, r=brson
Add socket timeout and ttl support in `sys::redox`

This adds support for `read_timeout`, `write_timeout`, and `ttl` on `TcpStream`, `TcpListener`, and `UdpSocket` in the `sys::redox` module.

The DNS lookup has been set to use a 5 second timeout by default.
2017-01-04 04:28:15 +00:00
Eduard-Mihai Burtescu
987f52f4f5 Update for changes to TraitItem on master. 2017-01-04 05:48:18 +02:00
Eduard-Mihai Burtescu
bb04da4822 Don't leak the compiler's internal representation of scopes in error messages. 2017-01-04 05:48:18 +02:00
Andrew Cann
70b7bd94cc Fix build after rebase 2017-01-04 11:07:32 +08:00
bors
a68622c899 Auto merge of #38809 - alexcrichton:rustbuild-fresh, r=brson
rustbuild: Fix a few rebuilding issues

Did a bit of investigation and found a few small unrelated issues, but this should help clean up a lot of errors we've been seeing locally.
2017-01-04 01:51:06 +00:00
bors
468227129d Auto merge of #38066 - bluss:string-slice-error, r=sfackler
Use more specific panic message for &str slicing errors

Separate out of bounds errors from character boundary errors, and print
more details for character boundary errors.

It reports the first error it finds in:

1. begin out of bounds
2. end out of bounds
3. begin <= end violated
3. begin not char boundary
5. end not char boundary.

Example:

    &"abcαβγ"[..4]

    thread 'str::test_slice_fail_boundary_1' panicked at 'byte index 4 is not
    a char boundary; it is inside 'α' (bytes 3..5) of `abcαβγ`'

Fixes #38052
2017-01-03 23:51:42 +00:00
Jeremy Soller
c6858a1429 Revert cargo.lock 2017-01-03 15:47:14 -07:00
Jeremy Soller
537b3aa3fd Remove -lc, -lm from the target spec - the cross compiler will link those 2017-01-03 15:42:41 -07:00