Commit Graph

51613 Commits

Author SHA1 Message Date
Niko Matsakis
c1a53a60e7 Address nit: doc-comments on fields 2016-03-23 16:42:54 -04:00
Niko Matsakis
a2bab6f3e1 Address nit: use doc-comments for fields of VarDecl 2016-03-23 16:42:53 -04:00
Niko Matsakis
14a5657a9a Rename MirPlusPlus to MirAndScopeAuxiliary 2016-03-23 16:42:53 -04:00
Niko Matsakis
f66fd8972f replace DUMMY_SP on resume with span from fn 2016-03-23 16:42:53 -04:00
Niko Matsakis
cb04e495dc rewrite drop code
This was triggered by me wanting to address a use of DUMMY_SP, but
actually I'm not sure what would be a better span -- I guess the span
for the function as a whole.
2016-03-23 16:42:53 -04:00
Niko Matsakis
f976e222e9 fix bug in simplify_cfg with inf. loops 2016-03-23 16:42:53 -04:00
Niko Matsakis
a61c1759c7 allow dumping intermediate IR with -Z dump-mir 2016-03-23 16:42:53 -04:00
Niko Matsakis
0d93989cf5 adjust pretty printer to print scopes / auxiliary 2016-03-23 16:42:53 -04:00
Niko Matsakis
d32bde3311 augment MIR pretty printer to print scopes 2016-03-23 16:42:52 -04:00
Niko Matsakis
caac0b969f reformat mir text pretty printer 2016-03-23 16:42:52 -04:00
Niko Matsakis
9d00deee96 add span/scope-id to terminator 2016-03-23 16:42:52 -04:00
Niko Matsakis
3a16f57fbb extend Terminator into a struct so it can have additional fields 2016-03-23 16:42:52 -04:00
Niko Matsakis
e752d4cde3 track the innermost scope for every stmt 2016-03-23 16:37:48 -04:00
Niko Matsakis
323d7f4e98 record a scope for each VarDecl 2016-03-23 16:37:48 -04:00
Niko Matsakis
464c02e336 integrate scopes into MIR 2016-03-23 16:37:48 -04:00
bors
b76f818cad Auto merge of #32390 - japaric:untry, r=pnkfelix
convert 99.9% of `try!`s to `?`s

The first commit is an automated conversion using the [untry] tool and the following command:

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

at the root of the Rust repo.

[untry]: https://github.com/japaric/untry

cc @rust-lang/lang @alexcrichton @brson
2016-03-23 08:59:10 -07:00
Jorge Aparicio
c063c5153f add back & that was deleted by mistake 2016-03-23 06:17:29 -05:00
bors
26cfc269a0 Auto merge of #32410 - Ticki:master, r=eddyb
Add support for naked functions

See https://github.com/rust-lang/rfcs/pull/1201#issuecomment-199442239

This PR adds `#[naked]` for marking naked functions.
2016-03-23 03:49:02 -07:00
bors
d6af19b89c Auto merge of #32348 - brson:cargotest, r=alexcrichton
Introduce 'cargotest' and the check-cargotest buildstep

This is a new suite of tests that verifies that the compiler builds specific revisions of select crates from crates.io.

It does not run by default. It is intended that bors runs these tests against all PRs, and gates on them. In this way we will make it harder still to break important swaths of the ecosystem, even on nightly.

This is a very basic implementation intended for feedback. The biggest thing it probably should do but doesn't is use a lockfile for every project it builds.

r? @alexcrichton cc @rust-lang/lang @rust-lang/libs
2016-03-23 01:03:04 -07:00
bors
8ba2ea5fad Auto merge of #32058 - pczarn:hashmap-initial-refactoring, r=apasel422
Basic refactoring of HashMap
2016-03-22 21:21:45 -07:00
Jorge Aparicio
c548eda362 enable question_mark feature in rustc_borrowck 2016-03-22 22:04:10 -05:00
Jorge Aparicio
2628f3cc8f fix alignment 2016-03-22 22:03:54 -05:00
Jorge Aparicio
bd71d11a8f break long line 2016-03-22 22:03:31 -05:00
Jorge Aparicio
acbf386ab4 term: undo conversion of user defined try!s 2016-03-22 22:03:19 -05:00
Jorge Aparicio
f88a1e6f21 std: undo conversion of user defined try!s 2016-03-22 22:03:08 -05:00
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
Brian Anderson
3a790acf19 Introduce 'cargotest' and the check-cargotest buildstep
This is a new suite of tests that verifies that the compiler
builds specific revisions of select crates from crates.io.

It does not run by default. It is intended that buildbot
runs these tests against all PRs, and gate on them.
2016-03-22 21:46:21 +00: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
Ticki
4869417b61 Add test for the feature gating of naked 2016-03-22 15:00:26 +01:00
Piotr Czarnecki
64adca717f f clarification, docs 2016-03-22 12:52:31 +01: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
Ticki
1f6b05e955 Add tests 2016-03-22 09:58:23 +01:00
Piotr Czarnecki
c9b3cd47e2 f Put and DerefMut 2016-03-22 09:45:51 +01: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
Piotr Czarnecki
c21d975503 f dead code 2016-03-21 23:53:55 +01: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
Ticki
1605ab377b Add support for naked functions 2016-03-21 21:01:08 +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