Commit Graph

53572 Commits

Author SHA1 Message Date
Guillaume Gomez
575149561e Rollup merge of #33753 - mmatyas:armtestfix, r=alexcrichton
Fix `asm-misplaced-option` on ARM/AArch64

This fixes rust-lang/rust#33737. Of course, since we don't run `make check` for ARM cross builds, you probably won't notice it.
2016-05-27 10:50:02 +02:00
bors
97e3a2401e Auto merge of #33783 - michaelwoerister:collector-cleanup-2, r=nikomatsakis
trans::collector: Remove some redundant calls to erase_regions().

r? @Aatch
2016-05-26 11:28:45 -07:00
bors
dc91467db0 Auto merge of #33766 - jseyfried:cleanup_expansion, r=nrc
Cleanup macro expansion and improve diagnostics

Cleanup macro expansion and improve diagnostics. Fixes #33709.
r? @nrc
2016-05-26 08:32:21 -07:00
bors
3c795e08d6 Auto merge of #33872 - nagisa:undef-is-llvm-for-sigsegv, r=eddyb
Fix handling of FFI arguments

r? @eddyb @nikomatsakis or whoever else.

cc @alexcrichton @rust-lang/core

The strategy employed here was to essentially change code we generate from

```llvm
  %s = alloca %S ; potentially smaller than argument, but never larger
  %1 = bitcast %S* %s to { i64, i64 }*
  store { i64, i64 } %0, { i64, i64 }* %1, align 4
```

to

```llvm
  %1 = alloca { i64, i64 } ; the copy of argument itself
  store { i64, i64 } %0, { i64, i64 }* %1, align 4
  %s = bitcast { i64, i64 }* %1 to %S* ; potentially truncate by casting to a pointer of smaller type.
```
2016-05-26 02:52:49 -07:00
Simonas Kazlauskas
5b404523dd Fix stores codegen pass 2016-05-26 12:41:40 +03:00
Simonas Kazlauskas
2f0da79e47 Do not forget to schedule the drop for the argument 2016-05-26 11:26:03 +03:00
bors
d5759a3417 Auto merge of #33699 - alexcrichton:stabilize-1.10, r=aturon
std: Stabilize APIs for the 1.10 release

This commit applies the FCP decisions made by the libs team for the 1.10 cycle,
including both new stabilizations and deprecations. Specifically, the list of
APIs is:

Stabilized:

* `os::windows::fs::OpenOptionsExt::access_mode`
* `os::windows::fs::OpenOptionsExt::share_mode`
* `os::windows::fs::OpenOptionsExt::custom_flags`
* `os::windows::fs::OpenOptionsExt::attributes`
* `os::windows::fs::OpenOptionsExt::security_qos_flags`
* `os::unix::fs::OpenOptionsExt::custom_flags`
* `sync::Weak::new`
* `Default for sync::Weak`
* `panic::set_hook`
* `panic::take_hook`
* `panic::PanicInfo`
* `panic::PanicInfo::payload`
* `panic::PanicInfo::location`
* `panic::Location`
* `panic::Location::file`
* `panic::Location::line`
* `ffi::CStr::from_bytes_with_nul`
* `ffi::CStr::from_bytes_with_nul_unchecked`
* `ffi::FromBytesWithNulError`
* `fs::Metadata::modified`
* `fs::Metadata::accessed`
* `fs::Metadata::created`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak`
* `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key`
* `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}`
* `SocketAddr::is_unnamed`
* `SocketAddr::as_pathname`
* `UnixStream::connect`
* `UnixStream::pair`
* `UnixStream::try_clone`
* `UnixStream::local_addr`
* `UnixStream::peer_addr`
* `UnixStream::set_read_timeout`
* `UnixStream::set_write_timeout`
* `UnixStream::read_timeout`
* `UnixStream::write_Timeout`
* `UnixStream::set_nonblocking`
* `UnixStream::take_error`
* `UnixStream::shutdown`
* Read/Write/RawFd impls for `UnixStream`
* `UnixListener::bind`
* `UnixListener::accept`
* `UnixListener::try_clone`
* `UnixListener::local_addr`
* `UnixListener::set_nonblocking`
* `UnixListener::take_error`
* `UnixListener::incoming`
* RawFd impls for `UnixListener`
* `UnixDatagram::bind`
* `UnixDatagram::unbound`
* `UnixDatagram::pair`
* `UnixDatagram::connect`
* `UnixDatagram::try_clone`
* `UnixDatagram::local_addr`
* `UnixDatagram::peer_addr`
* `UnixDatagram::recv_from`
* `UnixDatagram::recv`
* `UnixDatagram::send_to`
* `UnixDatagram::send`
* `UnixDatagram::set_read_timeout`
* `UnixDatagram::set_write_timeout`
* `UnixDatagram::read_timeout`
* `UnixDatagram::write_timeout`
* `UnixDatagram::set_nonblocking`
* `UnixDatagram::take_error`
* `UnixDatagram::shutdown`
* RawFd impls for `UnixDatagram`
* `{BTree,Hash}Map::values_mut`
* `<[_]>::binary_search_by_key`

Deprecated:

* `StaticCondvar` - this, and all other static synchronization primitives
                    below, are usable today through the lazy-static crate on
                    stable Rust today. Additionally, we'd like the non-static
                    versions to be directly usable in a static context one day,
                    so they're unlikely to be the final forms of the APIs in any
                    case.
* `CONDVAR_INIT`
* `StaticMutex`
* `MUTEX_INIT`
* `StaticRwLock`
* `RWLOCK_INIT`
* `iter::Peekable::is_empty`

Closes #27717
Closes #27720
Closes #30014
Closes #30425
Closes #30449
Closes #31190
Closes #31399
Closes #31767
Closes #32111
Closes #32281
Closes #32312
Closes #32551
Closes #33018
2016-05-25 20:36:09 -07:00
Simonas Kazlauskas
e0e50a4b74 Fix nit/Refine the datum construction 2016-05-26 03:38:17 +03:00
Simonas Kazlauskas
0d2a84c97d Fix the fix/hack interaction with debuginfo 2016-05-26 03:25:23 +03:00
bors
267cde2598 Auto merge of #33732 - nikomatsakis:incr-comp-empty-cgu, r=mw
always make at least one codegen-unit

this allows us to remove the dummy `foo` fn

r? @michaelwoerister
2016-05-25 16:53:05 -07:00
Simonas Kazlauskas
b9d014b73a Add a regression test 2016-05-26 02:48:25 +03:00
Simonas Kazlauskas
97bf80f427 Fix handling of C arguments
Fixes #33868
2016-05-26 02:45:13 +03:00
bors
34fd686681 Auto merge of #33667 - pnkfelix:fixes-to-mir-dataflow, r=arielb1
Fixes to mir dataflow

Fixes to mir dataflow

This collects a bunch of changes to `rustc_borrowck::borrowck::dataflow` (which others have pointed out should probably migrate to some crate that isn't tied to the borrow-checker -- but I have not attempted that here, especially since there are competing approaches to dataflow that we should also evaluate).

These changes:
 1. Provide a family of related analyses: MovingOutStatements (which is what the old AST-based dataflo computed), as well as MaybeInitialized, MaybeUninitalized, and DefinitelyInitialized.
   * (The last two are actually inverses of each other; we should pick one and drop the other.)
 2. Fix bugs in the pre-existing analysis implementation, which was untested and thus some obvious bugs went unnoticed, which brings us to the third point:
 3. Add a unit test infrastructure for the MIR dataflow analysis.
   * The tests work by adding a new intrinsic that is able to query the analysis state for a particular expression (technically, a particular L-value).
   * See the examples in compile-fail/mir-dataflow/inits-1.rs and compile-fail/mir-dataflow/uninits-1.rs
   * These tests are only checking the results for MaybeInitialized, MaybeUninitalized, and DefinitelyInitialized; I am not sure if it will be feasible to generalize this testing strategy to the MovingOutStatements dataflow operator.
2016-05-25 12:34:39 -07: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
Felix S. Klock II
df5c116250 Alpha rename OwnIdxSet to IdxSetBuf. 2016-05-25 15:55:46 +02:00
Felix S. Klock II
ad0e6adbb1 fixes to indexed_set: add comments and fix PhantomData def'n. 2016-05-25 15:53:59 +02:00
Felix S. Klock II
a28771cc97 remove indexed_set::Indexed trait. 2016-05-25 15:41:57 +02:00
Felix S. Klock II
58f1a4949d remove unnecessary use of indexed_set::Indexed trait. 2016-05-25 15:41:49 +02:00
Felix S. Klock II
25f37fd651 Add notes that data-structures should potentially move to different crate. 2016-05-25 14:54:31 +02:00
Felix S. Klock II
d9680f5b36 Fix some comments. 2016-05-25 14:52:40 +02: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
Felix S. Klock II
4412c7ab37 placate tidy in compile-fail test. 2016-05-24 23:08:34 +02:00
Felix S. Klock II
fe49b41f83 placate tidy in mir::gather_moves. 2016-05-24 23:08:24 +02:00
Felix S. Klock II
ac6ea44549 placate tidy in mir::dataflow. 2016-05-24 23:08:16 +02:00
Felix S. Klock II
a82676eefa placate tidy in mir::dataflow::graphviz. 2016-05-24 23:08:07 +02:00
Felix S. Klock II
ad1294dbe7 threaded a ty::ParameterEnvironment for the current node id via the associated Ctxt item.
used this to address a long-standing wart/bug in how filtering-out of
values with type impl'ing `Copy` was done.
2016-05-24 23:03:52 +02:00
Niko Matsakis
be7b576cc5 correct typo in comment 2016-05-24 15:08:07 -04: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
Alex Crichton
cae91d7c8c std: Stabilize APIs for the 1.10 release
This commit applies the FCP decisions made by the libs team for the 1.10 cycle,
including both new stabilizations and deprecations. Specifically, the list of
APIs is:

Stabilized:

* `os::windows::fs::OpenOptionsExt::access_mode`
* `os::windows::fs::OpenOptionsExt::share_mode`
* `os::windows::fs::OpenOptionsExt::custom_flags`
* `os::windows::fs::OpenOptionsExt::attributes`
* `os::windows::fs::OpenOptionsExt::security_qos_flags`
* `os::unix::fs::OpenOptionsExt::custom_flags`
* `sync::Weak::new`
* `Default for sync::Weak`
* `panic::set_hook`
* `panic::take_hook`
* `panic::PanicInfo`
* `panic::PanicInfo::payload`
* `panic::PanicInfo::location`
* `panic::Location`
* `panic::Location::file`
* `panic::Location::line`
* `ffi::CStr::from_bytes_with_nul`
* `ffi::CStr::from_bytes_with_nul_unchecked`
* `ffi::FromBytesWithNulError`
* `fs::Metadata::modified`
* `fs::Metadata::accessed`
* `fs::Metadata::created`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak`
* `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key`
* `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}`
* `SocketAddr::is_unnamed`
* `SocketAddr::as_pathname`
* `UnixStream::connect`
* `UnixStream::pair`
* `UnixStream::try_clone`
* `UnixStream::local_addr`
* `UnixStream::peer_addr`
* `UnixStream::set_read_timeout`
* `UnixStream::set_write_timeout`
* `UnixStream::read_timeout`
* `UnixStream::write_Timeout`
* `UnixStream::set_nonblocking`
* `UnixStream::take_error`
* `UnixStream::shutdown`
* Read/Write/RawFd impls for `UnixStream`
* `UnixListener::bind`
* `UnixListener::accept`
* `UnixListener::try_clone`
* `UnixListener::local_addr`
* `UnixListener::set_nonblocking`
* `UnixListener::take_error`
* `UnixListener::incoming`
* RawFd impls for `UnixListener`
* `UnixDatagram::bind`
* `UnixDatagram::unbound`
* `UnixDatagram::pair`
* `UnixDatagram::connect`
* `UnixDatagram::try_clone`
* `UnixDatagram::local_addr`
* `UnixDatagram::peer_addr`
* `UnixDatagram::recv_from`
* `UnixDatagram::recv`
* `UnixDatagram::send_to`
* `UnixDatagram::send`
* `UnixDatagram::set_read_timeout`
* `UnixDatagram::set_write_timeout`
* `UnixDatagram::read_timeout`
* `UnixDatagram::write_timeout`
* `UnixDatagram::set_nonblocking`
* `UnixDatagram::take_error`
* `UnixDatagram::shutdown`
* RawFd impls for `UnixDatagram`
* `{BTree,Hash}Map::values_mut`
* `<[_]>::binary_search_by_key`

Deprecated:

* `StaticCondvar` - this, and all other static synchronization primitives
                    below, are usable today through the lazy-static crate on
                    stable Rust today. Additionally, we'd like the non-static
                    versions to be directly usable in a static context one day,
                    so they're unlikely to be the final forms of the APIs in any
                    case.
* `CONDVAR_INIT`
* `StaticMutex`
* `MUTEX_INIT`
* `StaticRwLock`
* `RWLOCK_INIT`
* `iter::Peekable::is_empty`

Closes #27717
Closes #27720
cc #27784 (but encode methods still exist)
Closes #30014
Closes #30425
Closes #30449
Closes #31190
Closes #31399
Closes #31767
Closes #32111
Closes #32281
Closes #32312
Closes #32551
Closes #33018
2016-05-24 09:00:39 -07:00
Felix S. Klock II
fdf80bc60c Removed type Bit and fn interpret items from trait BitDenotation.
Also got rid of the `trait HasMoveData`, since I am now just imposing
the constraint that `BitDenotation<Ctxt=MoveData<'tcx>>` where
necessary instead.
2016-05-24 16:46:19 +02:00
Felix S. Klock II
0cf5f1023e Replaced use of interpret method in mir::dataflow::graphviz with a client-provided closure. 2016-05-24 16:16:42 +02:00
Felix S. Klock II
221cce915a move the tcx and mir parts of associated Ctxt onto each BitDenotation impl. 2016-05-24 15:01:48 +02:00
Jeffrey Seyfried
e9c0283369 Add comments and fix a nit 2016-05-24 11:48:00 +00:00
Felix S. Klock II
ae09c5e36e Moved the four impls of BitDenotation to their own module, mod impls. 2016-05-24 13:26:54 +02: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
Felix S. Klock II
ede29581d2 mir::dataflow::sanity_check: extract an fn each_block to simplify presentation.
As a drive-by: unified pair of match arms that flowed to `bug!`, and
replaced `bug!` invocation with a diagnostic `span_err` invocation.
2016-05-24 12:56:02 +02:00