Commit Graph

51572 Commits

Author SHA1 Message Date
Jorge Aparicio
aa7fe93d4a sprinkle feature gates here and there 2016-03-22 22:02:47 -05:00
Jorge Aparicio
0f02309e4b try! -> ?
Automated conversion using the untry tool [1] and the following command:

```
$ find -name '*.rs' -type f | xargs untry
```

at the root of the Rust repo.

[1]: https://github.com/japaric/untry
2016-03-22 22:01:37 -05:00
bors
0dcc413e42 Auto merge of #32204 - alexcrichton:redesign-char-encoding-types, r=aturon
std: Change `encode_utf{8,16}` to return iterators

Currently these have non-traditional APIs which take a buffer and report how
much was filled in, but they're not necessarily ergonomic to use. Returning an
iterator which *also* exposes an underlying slice shouldn't result in any
performance loss as it's just a lazy version of the same implementation, and
it's also much more ergonomic!

cc #27784
2016-03-22 16:05:39 -07:00
Alex Crichton
48d5fe9ec5 std: Change encode_utf{8,16} to return iterators
Currently these have non-traditional APIs which take a buffer and report how
much was filled in, but they're not necessarily ergonomic to use. Returning an
iterator which *also* exposes an underlying slice shouldn't result in any
performance loss as it's just a lazy version of the same implementation, and
it's also much more ergonomic!

cc #27784
2016-03-22 10:25:30 -07:00
bors
e3f2dfdece Auto merge of #32156 - pnkfelix:borrowck-on-mir-move-analysis, r=nikomatsakis
Move analysis for MIR borrowck

This PR adds code for doing MIR-based gathering of the moves in a `fn` and the dataflow to determine where uninitialized locations flow to, analogous to how the same thing is done in `borrowck`.

It also adds a couple attributes to print out graphviz visualizations of the analyzed MIR that includes the dataflow analysis results.

cc @nikomatsakis
2016-03-22 10:00:12 -07:00
Felix S. Klock II
782c0cf4a2 Add rustbuild dependency from rustc_borrowck upon rustc_mir crate. 2016-03-22 18:09:57 +01:00
bors
c7bdfd4442 Auto merge of #32341 - frewsxcv:compiletest-enum, r=nikomatsakis
Use enum for message kind in compiletest harness.

None
2016-03-22 08:02:13 -07:00
bors
2ae05d37da Auto merge of #32264 - GuillaumeGomez:lang_item, r=nikomatsakis
Lang item

Fixes #32033
2016-03-22 04:06:59 -07:00
bors
8fc0554e4d Auto merge of #32388 - semarie:snapshot-openbsd, r=alexcrichton
register openbsd snapshot

Here openbsd version for latest snapshot.

The archive is at http://semarie.online.fr/rust/rust-stage0-2016-03-18-235d774-openbsd-x86_64-c5b6feda38138a12cd5c05574b585dadebbb5e87.tar.bz2

These segmentation fault starts to be annoying. @dhuseby do you think it would be possible to have a shell access to openbsd buildbot in order to try to investigating a bit the reason of them ?

r? @alexcrichton
Ref #32345
2016-03-22 02:05:16 -07:00
bors
6cc502c986 Auto merge of #32253 - durka:derive-31886, r=alexcrichton
derive: assume enum repr defaults to isize

derive: assume enum repr defaults to isize

Fixes #31886.

Spawned from #32139.

r? @alexcrichton
2016-03-21 21:07:28 -07:00
bors
4621dd2171 Auto merge of #32402 - steveklabnik:rollup, r=steveklabnik
Rollup of 6 pull requests

- Successful merges: #32322, #32339, #32340, #32373, #32376, #32397
- Failed merges:
2016-03-21 18:36:13 -07:00
Corey Farwell
73f4321892 Refactor 'kind' extraction to use str::split_whitespace. 2016-03-21 21:16:07 -04:00
bors
21922e1f48 Auto merge of #32062 - Marwes:unification_table_for_eq_relations, r=nikomatsakis
Improve time complexity of equality relations

This PR adds a `UnificationTable` to the `TypeVariableTable` type which is used store information about variable equality instead of just storing them in a vector for later processing. By using a `UnificationTable` equality relations can be resolved in O(n) (for all realistic values of n) rather than O(n!) which can give massive speedups in certain cases (see combine as an example).

Link to combine: https://github.com/Marwes/combine
2016-03-21 16:00:08 -07:00
Markus Westerlind
e00cdd7345 Improve time complexity of equality relations
This PR adds a `UnificationTable` to the `TypeVariableTable` type which
is used store information about variable equality instead of just
storing them in a vector for later processing. By using a
`UnificationTable` equality relations can be resolved in O(n) (for all
realistic values of n) rather than O(n!) which can give massive
speedups in certain cases (see combine as an example).

Link to combine: https://github.com/Marwes/combine
2016-03-21 22:40:30 +01:00
bors
0168dc7c59 Auto merge of #32393 - dotdash:32389, r=eddyb
Fix tupling of fn args for rust-call ABI functions

Fixes #32389
2016-03-21 11:03:17 -07:00
Felix S. Klock II
dd99f58fe1 assigning a (MIR) box into an lvalue allocates heap storage that will
need to be initialized. create a MoveOut to represent that deref'ed
`*lval` path.
2016-03-21 18:36:23 +01:00
Felix S. Klock II
5508c40d04 remove uses of RefCell from move data builder. 2016-03-21 18:36:23 +01:00
Felix S. Klock II
dda892a83d Make fn move_path_for take &mut self instead of &self. This is a
precursor for a number of other simplifying changes (mostly removing
uses of `RefCell`).

Factor lookup method out of `fn move_path_for`.
2016-03-21 18:36:23 +01:00
Felix S. Klock II
9901768b4c dont create MovePathIndex's for individual statics.
Instead, create a single MovePathIndex that represents all statics.

(An alternative here would be to disallow representing statics at all.
I am hesitant to do that right now, in part because it could impose a
requirement that I thread checks for static data into the calling
code, either as pre- or post-invocation of `fn move_path_for`.)
2016-03-21 18:36:23 +01:00
Felix S. Klock II
9b67d099f5 Switch newtype Index wrappers to use NonZero instead of INVALID constants. 2016-03-21 18:36:23 +01:00
Felix S. Klock II
7d53a25b38 factor the wrapped Index newtype definitions into a macro. 2016-03-21 18:36:22 +01:00
Felix S. Klock II
24ff327484 Add fn clear_bit method on BitSlice trait for setting a bit to zero. 2016-03-21 18:36:22 +01:00
Felix S. Klock II
5757e65f7a scaffolding for borrowck on MIR.
emit (via debug!) scary message from `fn borrowck_mir` until basic
prototype is in place.

Gather children of move paths and set their kill bits in
dataflow. (Each node has a link to the child that is first among its
siblings.)

Hooked in libgraphviz based rendering, including of borrowck dataflow
state.

doing this well required some refactoring of the code, so I cleaned it
up more generally (adding comments to explain what its trying to do
and how it is doing it).

Update: this newer version addresses most review comments (at least
the ones that were largely mechanical changes), but I left the more
interesting revisions to separate followup commits (in this same PR).
2016-03-21 18:36:22 +01:00
Felix S. Klock II
213d57983d Expose attached attributes to FnKind abstraction so that I can look at them in borrowck. 2016-03-21 18:36:22 +01:00
Felix S. Klock II
baeae780e0 Switch libgraphviz from type params to associated types for Node/Edge. 2016-03-21 18:36:14 +01:00
Steve Klabnik
6a3c7d5630 Rollup merge of #32397 - tclfs:patch-7, r=steveklabnik
docs: Make some changes in texts

In my understanding, the description is somehow inappropriate.
2016-03-21 11:46:53 -04:00
Steve Klabnik
29b09087c8 Rollup merge of #32376 - cyplo:cyplo_fix_E0368_documentation, r=steveklabnik
Documentation fix for E0368

Made the 'good' example compile.

I got to the [E0368 error page](https://doc.rust-lang.org/error-index.html#E0368) by following the link in the output of the
compiler. My understanding is that the first example is 'bad' and the
second one is 'good'. Following that logic, I pasted the second example
into the file and to my surprise it did not compile. This commit fixes
the example to make it paste-able.

On the other hand the docstring contained `compile_fail` flag, which might indicate that this was intentional.
I am also assuming here that the `Rust Compiler Error Index` page is generated from the file I changed.

Please let me know what do you think. Thanks a lot !
2016-03-21 11:46:53 -04:00
Steve Klabnik
078b288ebd Rollup merge of #32373 - tclfs:patch-5, r=steveklabnik
docs: Correct an  improper description

In the example, we made a immutable borrow to `println!`, not a mutable one.
2016-03-21 11:46:53 -04:00
Steve Klabnik
3c3b9ad76a Rollup merge of #32340 - Digipom:master, r=steveklabnik
Update of the book; Error handling, section on custom error types: we…

… should also show the changes to the `cause` method.

When I started creating my own error type, I found that we also have to update the cause method, otherwise we have a missing match branch.

It would also be nice to elaborate on the relationship and difference between the description() and fmt() method, but that should be done by someone with more experience with them. :)
2016-03-21 11:46:52 -04:00
Steve Klabnik
0694d63674 Rollup merge of #32339 - tclfs:patch-4, r=apasel422
docs: make some tiny modification about spelling

I think it would be better after modification.
2016-03-21 11:46:52 -04:00
Steve Klabnik
4ed70c2bc8 Rollup merge of #32322 - GuillaumeGomez:cmp_doc, r=steveklabnik
Add doc examples

Fixes #29347

r? @steveklabnik
2016-03-21 11:46:52 -04:00
bors
0215681744 Auto merge of #32378 - petrochenkov:patch-1, r=alexcrichton
Correct Windows build instructions in README.md

http://mingw-w64.org/doku.php/download/mingw-builds now provides GCC 5.3 as a default version, but avoiding 5.x is exactly the reason why Mingw-builds are recommended instead of MSYS2's own mingw toolchain. One of the 4.9.x versions has to be manually chosen during installation.

r? @alexcrichton
2016-03-21 06:35:17 -07:00
Tang Chenglong
a5d9057ca7 docs: Make some changes in texts
In my understanding, the description is somehow inappropriate.
2016-03-21 21:00:04 +08:00
Björn Steinbrink
4fd318b9e9 Fix tupling of fn args for rust-call ABI functions
Fixes #32389
2016-03-21 12:22:29 +01:00
bors
690f160f8f Auto merge of #32369 - frewsxcv:librustc-driver-lib, r=alexcrichton
Minor cleanup for 'src/librustc_driver/lib.rs'

Reading through this file my first time. Cleaned up some stuff on the way.
2016-03-21 03:27:53 -07:00
bors
7ec8f5c369 Auto merge of #32054 - seanmonstar:impl-debug-core, r=alexcrichton
libcore: add Debug implementations to most missing types

Also adds `#![deny(missing_debug_implementations)]` to the core crate.

cc #31869
2016-03-21 00:07:33 -07:00
Sébastien Marie
6e4bc47890 register openbsd snapshot 2016-03-21 06:04:57 +01:00
bors
6c4b1f18f3 Auto merge of #32302 - sfackler:unix-socket, r=alexcrichton
Add unix socket support to the standard library

r? @alexcrichton
2016-03-20 20:13:49 -07:00
Steven Fackler
c0d989ed6b Add unix socket support to the standard library 2016-03-20 18:57:58 -07:00
bors
7f5c568e0a Auto merge of #32344 - aturon:issue-32324, r=eddyb
Fix mis-uses of projection mode

A couple of places where we construct a fresh inference context were
incorrectly assuming that we were past coherence checking. This commit
corrects them to use `Topmost` rather than `AnyFinal` as the projection mode.

Fixes #32324

r? @nikomatsakis
2016-03-20 17:48:09 -07:00
bors
399b52217b Auto merge of #32345 - eddyb:snap-to-orbit, r=alexcrichton
Update snapshots to 2016-03-18 (235d774).

The new snapshots notably include @nikomatsakis' #32164 fix for the regionck error spew.
Also, `./configure --enable-orbit` *and/or* `make RUSTFLAGS="-Z orbit"` should work now (#32080).
2016-03-20 14:46:22 -07:00
Eduard Burtescu
ec84ab0e0f Update snapshots to 2016-03-18 (235d774). 2016-03-20 22:37:35 +02:00
Aaron Turon
09263a6137 Fix mis-uses of projection mode
A couple of places where we construct a fresh inference context were
incorrectly assuming that we were past coherence checking. This commit
corrects them to use `Topmost` rather than `AnyFinal` as the projection mode.

Fixes #32324
2016-03-20 13:37:28 -07:00
Vadim Petrochenkov
90474c7930 Correct Windows build instructions in README.md
http://mingw-w64.org/doku.php/download/mingw-builds now provides GCC 5.x as a default version, but avoiding 5.x is exactly the reason why Mingw-builds is recommended instead of MSYS2's own mingw toolchain. One of the 4.9.x versions has to manually chosen during installation.
2016-03-20 23:36:48 +03:00
bors
2af3dd73db Auto merge of #32010 - devonhollowood:non-c-like-enum-repr, r=Aatch
Add tests for #26114

First step in fixing #26114
2016-03-20 12:49:46 -07:00
Cyryl Płotnicki-Chudyk
903bcb84a1 Documentation fix for E0368
Made the 'good' example compile.

I got to the E0368 error page by following the link in the output of the
compiler. My understanding is that the first example is 'bad' and the
second one is 'good'. Following that logic, I pasted the second example
into the file and to my surprise it did not compile. This commit fixes
the example to make it paste-able.
2016-03-20 19:27:00 +01:00
bors
978bc070a6 Auto merge of #32375 - phil-opp:patch-1, r=japaric
docs: The `data-layout` field is no longer required in custom targets

The `data-layout` field is no longer required. It was made optional in 958d563825.

The `os` field is always required.

Related to #31367
2016-03-20 10:30:38 -07:00
Sean McArthur
e0945937c4 libcore: add Debug implementations to most missing types 2016-03-20 10:04:55 -07:00
Philipp Oppermann
953260208a The data-layout field is no longer required, but the os field is
The `data-layout` field  was made optional in 958d563825. The `os` field is always required.
2016-03-20 17:18:39 +01:00
Corey Farwell
4d52b0f550 Utilize if..let over single match branch. 2016-03-20 11:01:23 -04:00