Commit Graph

58732 Commits

Author SHA1 Message Date
Havvy
9ddbb9133c Added Graph::is_cyclicic_node algorithm 2016-11-02 21:57:36 -07:00
Simonas Kazlauskas
475236770f A way to remove otherwise unused locals from MIR
Replaces the hack where a similar thing is done within trans.
2016-11-03 06:17:01 +02:00
Brian Anderson
5ad235c8c0 Bump the bootstrap cargo to match the one paired with 1.13 2016-11-03 01:00:55 +00:00
Alex Crichton
a270b8014c rustbuild: Rewrite user-facing interface
This commit is a rewrite of the user-facing interface to the rustbuild build
system. The intention here is to make it much easier to compile/test the project
without having to remember weird rule names and such. An overall view of the new
interface is:

    # build everything
    ./x.py build

    # document everyting
    ./x.py doc

    # test everything
    ./x.py test

    # test libstd
    ./x.py test src/libstd

    # build libcore stage0
    ./x.py build src/libcore --stage 0

    # run stage1 run-pass tests
    ./x.py test src/test/run-pass --stage 1

The `src/bootstrap/bootstrap.py` script is now aliased as a top-level `x.py`
script. This `x` was chosen to be both short and easily tab-completable (no
collisions in that namespace!). The build system now accepts a "subcommand" of
what to do next, the main ones being build/doc/test.

Each subcommand then receives an optional list of arguments. These arguments are
paths in the source repo of what to work with. That is, if you want to test a
directory, you just pass that directory as an argument.

The purpose of this rewrite is to do away with all of the arcane renames like
"rpass" is the "run-pass" suite, "cfail" is the "compile-fail" suite, etc. By
simply working with directories and files it's much more intuitive of how to run
a test (just pass it as an argument).

The rustbuild step/dependency management was also rewritten along the way to
make this easy to work with and define, but that's largely just a refactoring of
what was there before.

The *intention* is that this support is extended for arbitrary files (e.g.
`src/test/run-pass/my-test-case.rs`), but that isn't quite implemented just yet.
Instead directories work for now but we can follow up with stricter path
filtering logic to plumb through all the arguments.
2016-11-02 17:57:28 -07:00
bors
f9f45c6dac Auto merge of #36993 - nnethercote:obligation, r=nikomatsakis
Optimize ObligationForest's NodeState handling.

This commit does the following.
- Changes `NodeState` from an enum to a `bitflags`. This makes it
  possible to check against multiple possible values in a single bitwise
  operation.
- Replaces all the hot `match`es involving `NodeState` with `if`/`else`
  chains that ensure that cases are handled in the order of frequency.
- Partially inlines two functions, `find_cycles_from_node` and
  `mark_as_waiting_from`, at two call sites in order to avoid function
  unnecessary function calls on hot paths.
- Fully inlines and removes `is_popped`.

These changes speeds up rustc-benchmarks/inflate-0.1.0 by about 7% when
doing debug builds with a stage1 compiler.

r? @arielb1
2016-11-02 17:46:44 -07:00
Vadim Petrochenkov
50ecee2410 Add feature gate for Self and associated types in struct expressions and patterns 2016-11-03 03:32:28 +03:00
Vadim Petrochenkov
74bb594563 Stabilize .. in tuple (struct) patterns 2016-11-03 01:38:15 +03:00
Niko Matsakis
b4f910d900 just use full-normalization when for the impl trait ref
This seems better because I want to avoid the situation where unresolved
inference variables make it into the environment.  On the other hand, I
am not 100% sure that this is correct. My assumption was that the WF
check should ensure that this normalization can succeed. But it occurs
to me that the WF checks may need to make use of the `specializes`
predicate themselves, and hence we may have a kind of cycle here (this
is a bigger problem with spec in any case that we need to resolve).

On the other hand, this should just cause extra errors I think, so it
seems like a safe thing to attempt. Certainly all tests pass.
2016-11-02 18:18:24 -04:00
Niko Matsakis
d9bc86032d normalize trait-ref in context of impl
The `specializes()` function was trying to normalize the impl trait in
an empty environment. This could lead to inexplicable failures.
2016-11-02 18:18:24 -04:00
Niko Matsakis
797e0420e3 add #32791 test case 2016-11-02 18:18:24 -04:00
Nicholas Nethercote
d73c68ceef leb128-encode integers before hashing them in IchHasher.
This significantly reduces the number of bytes hashed by IchHasher.
2016-11-03 09:05:56 +11:00
bors
5665bdf3e3 Auto merge of #37540 - jonathandturner:rollup, r=jonathandturner
Rollup of 10 pull requests

- Successful merges: #37351, #37405, #37473, #37482, #37488, #37498, #37502, #37513, #37517, #37523
- Failed merges: #37521
2016-11-02 14:29:31 -07:00
Jonathan Turner
0befab2343 Rollup merge of #37523 - d-unseductable:deref_mut_lifetimes, r=bluss
Elide lifetimes in DerefMut documentation

 - Elide lifetimes to increase the readability of `DerefMut` examples
2016-11-02 15:09:43 -04:00
Jonathan Turner
805aecc36a Rollup merge of #37517 - Mark-Simulacrum:add-unwrap-default-tracking-issue, r=alexcrichton
Add tracking issue number to Result::unwrap_or_default unstable annotation.

Implemented in https://github.com/rust-lang/rust/pull/37299.

Tracking issue: https://github.com/rust-lang/rust/issues/37516.
2016-11-02 15:09:42 -04:00
Jonathan Turner
27f41b7001 Rollup merge of #37513 - michaelwoerister:hash-panic-spans, r=nikomatsakis
ICH: Hash expression spans if their source location is captured for panics.

Since the location of some expressions is captured in error message constants, it has an influence on machine code and consequently we need to take them into account by the incr. comp. hash. This PR makes this happen for `+, -, *, /, %` and for array indexing -- let me know if I forgot anything.

In the future we might want to change the codegen strategy for those error messages, so that they are stored in a separate object file with a stable symbol name, so that only this object file has to be regenerated when source locations change. This strategy would also eliminate unnecessary duplications due  to monomorphization, as @arielb1 has pointed out on IRC. I opened https://github.com/rust-lang/rust/issues/37512, so we don't forget about this.

r? @nikomatsakis
2016-11-02 15:09:42 -04:00
Jonathan Turner
62e026be5a Rollup merge of #37502 - CryZe:patch-4, r=sfackler
Add missing space in mutable_transmutes lint
2016-11-02 15:09:42 -04:00
Jonathan Turner
b333860611 Rollup merge of #37498 - sanxiyn:unused-type-alias, r=eddyb
Remove unused type aliases

Found by extending the dead code lint. The lint itself is work in progress because of false positives.

cc #37455.
2016-11-02 15:09:42 -04:00
Jonathan Turner
d2f4a9d7be Rollup merge of #37488 - frewsxcv:quiet-travis, r=alexcrichton
Use quieter test output when running tests on Travis CI.

Fixes https://github.com/rust-lang/rust/issues/36788.
2016-11-02 15:09:41 -04:00
Jonathan Turner
0a20ec3743 Rollup merge of #37482 - matwey:configure-arm, r=alexcrichton
Misc fixes for configure

Currently,
`./configure` at armv6 machines ends up with

```
configure: error: unknown CPU type: armv6l
```

`./configure` at armv7 machines **silently** produces build for armv6 (compatible, but suboptimal)

```
configure: CFG_BUILD            := arm-unknown-linux-gnueabihf
```
2016-11-02 15:09:41 -04:00
Jonathan Turner
3752673cbc Rollup merge of #37473 - joshtriplett:doc-copyedit-write-writeln, r=alexcrichton
Copyediting on documentation for write! and writeln!

Fix various sentence fragments, missing articles, and other grammatical issues in the documentation for write! and writeln!.

Also fix the links (and link names) for common return types.

(Noticed when preparing https://github.com/rust-lang/rust/pull/37472 ; posted separately to avoid mixing the new documentation with copyedits to existing documentation.)
2016-11-02 15:09:41 -04:00
Jonathan Turner
dbb2506b72 Rollup merge of #37405 - mikhail-m1:dnlle, r=jonathandturner
Improve "Doesn't live long enough" error

case with different lifetime scope

issue #36537 part of #35233
r? @jonathandturner
2016-11-02 15:09:41 -04:00
Jonathan Turner
d00e5e9343 Rollup merge of #37351 - Amanieu:consume, r=alexcrichton
Prevent exhaustive matching of Ordering to allow for future extension

The C++11 atomic memory model defines a `memory_order_consume` ordering which is generally equivalent to `memory_order_acquire` but can allow better code generation by avoiding memory barrier instructions. Most compilers (including LLVM) currently do not implement this ordering directly and instead treat it identically to `memory_order_acquire`, including adding a memory barrier instruction.

There is currently [work](http://open-std.org/Jtc1/sc22/wg21/docs/papers/2016/p0098r1.pdf) to support consume ordering in compilers, and it would be a shame if Rust did not support this. This PR therefore reserves a `__Nonexhaustive` variant in `Ordering` so that adding a new ordering is not a breaking change in the future.

This is a [breaking-change] since it disallows exhaustive matching on `Ordering`, however a search of all Rust code on Github shows that there is no code that does this. This makes sense since `Ordering` is typically only used as a parameter to an atomic operation.
2016-11-02 15:09:41 -04:00
Guillaume Gomez
942f909c1f Add missing urls for ErrorKind's variants 2016-11-02 19:08:10 +01:00
bors
0ca9967af7 Auto merge of #36948 - brson:sys, r=brson
More refactoring to obey platform abstraction lint

The most interesting things here are moving `std/sys/common` to `std/sys_common`, and `std/num/{f32,f64}.rs` to `std/{f32,f64}.rs`, and adding more documentation to `std/lib.rs`.

r? @alexcrichton
2016-11-02 08:44:33 -07:00
Mark-Simulacrum
99234bbe9e Add a new non-heap allocated variant to io::Error's representation.
Implement From<ErrorKind> for io::Error, intended for use with errors
that should never be exposed to the user.
2016-11-02 09:01:14 -06:00
Mark-Simulacrum
2af61112d4 Add Error implementation for std::sync::mpsc::RecvTimeoutError. 2016-11-02 08:59:55 -06:00
Matthew Piziak
8f19d5c3f6 add max value from iterator 2016-11-02 10:11:53 -04:00
Michael Woerister
0e391bf22c ICH: Add test case for when overflow checks are disabled. 2016-11-02 10:00:11 -04:00
bors
acfe959701 Auto merge of #37054 - rednum:master, r=alexcrichton
Add or and or_else for ordering.

Fixes https://github.com/rust-lang/rust/issues/37053 (see discussion in rust-lang/rfcs#1677).
2016-11-02 05:37:33 -07:00
Havvy
7d91581cca Change Make comment into doc comment on Graph::iterate_until_fixed_point 2016-11-02 01:48:11 -07:00
Havvy
fcf02623ee Added general iterators for graph nodes and edges
Also used those general iterators in other methods.
2016-11-02 01:47:54 -07:00
Jeffrey Seyfried
1e6c275b1c Add regression test. 2016-11-02 07:42:42 +00:00
Jeffrey Seyfried
076c5d445b Fix shadowing checking. 2016-11-02 07:42:37 +00:00
bors
35a1fefa88 Auto merge of #36131 - Florob:entry_typeck, r=eddyb
typeck: Fix error reporting of wrong entry function signatures

Expected and actual type were switched, this was introduced by
refactoring in 8eb12d91aa.
2016-11-01 23:50:05 -07:00
Havvy
3d1ecc50ed Normalize generic bounds in graph iterators
Use where clasues and only where clauses for bounds in the
iterators for Graph.

The rest of the code uses bounds on the generic declarations for
Debug, and we may want to change those to for consistency. I did
not do that here because I don't know whether or not that's a good
idea. But for the iterators, they were inconsistent causing
confusion, at least for me.
2016-11-01 20:32:02 -07:00
Nicholas Nethercote
af0b27e01f Don't hash span filenames twice in IchHasher.
This significantly reduces the number of bytes hashed by IchHasher.
2016-11-02 14:17:36 +11:00
bors
3fba503bf5 Auto merge of #37514 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #36849, #37059, #37296, #37316, #37484, #37485, #37495
- Failed merges:
2016-11-01 19:38:16 -07:00
Nicholas Nethercote
7b33f7e3e7 Optimize ObligationForest's NodeState handling.
This commit partially inlines two functions, `find_cycles_from_node` and
`mark_as_waiting_from`, at two call sites in order to avoid function
unnecessary function calls on hot paths.

It also fully inlines and removes `is_popped`.

These changes speeds up rustc-benchmarks/inflate-0.1.0 by about 2% when
doing debug builds with a stage1 compiler.
2016-11-02 13:37:10 +11:00
Eduard Burtescu
0d7201ef46 rustc: record the target type of every adjustment. 2016-11-02 04:00:02 +02:00
Eduard Burtescu
6a8d131e5d rustc: make all read access to tcx.tables go through a method. 2016-11-02 03:50:32 +02:00
Dmitry Gritsay
7d5b788edf Elide lifetimes in DerefMut documentation
- Elide lifetimes to increase the readability
   of `DerefMut` examples
2016-11-01 23:18:02 +02:00
bors
7c69b0d5ae Auto merge of #37491 - Mark-Simulacrum:closure-ice, r=eddyb
Fix ICE when printing closures, and other similar types

Follow-up of https://github.com/rust-lang/rust/pull/37459, further fixes those problems.

Potentially actually fixes #36622, though @eddyb may want to not let that close if the rename of RUST_LOG is deemed part of that issue.

Potentially should be beta-nominated as well?

r? @eddyb
2016-11-01 12:20:03 -07:00
Niko Matsakis
4501e5a52f remove erroneous E0045 annotation
The old parse code kept going even though it wasn't
supposed to, leading to an E0045 ("feature not allowed
on beta") printout
2016-11-01 14:08:56 -04:00
Niko Matsakis
6236ee14af add -Z continue-parse-after-error to parse-fail tests
The new handling fixed a latent bug in the parser error handling where
it would only abort after the second error (when configured to stop
after the first error). This is because the check for `error_count != 0`
was occuring before the increment. Since the increment is tied to the
`emit()` call now this no longer occurs.
2016-11-01 14:08:56 -04:00
Niko Matsakis
ad46ad6a77 pacify the mercilous tidy 2016-11-01 14:08:56 -04:00
Niko Matsakis
fa9ebfc74e move compile-fail tests to ui tests
gets more comprehensive coverage in `ui`
2016-11-01 14:08:56 -04:00
Niko Matsakis
222349931e apply review feedback nits
- correct indentation
- rename `from_cause` to `from_obligation_cause`
- break up `compare_impl_method` into fns
- delete some blank lines and correct comment
2016-11-01 14:08:56 -04:00
Niko Matsakis
b6597528bd update extra_requirement_in_impl to #37166 2016-11-01 14:08:56 -04:00
Niko Matsakis
92529255c5 update test error messages
We've got a new revised message for E0273; just drop back to the error
code, since the ui tests check for the full appearance now.
2016-11-01 14:08:56 -04:00
Niko Matsakis
61c777baec introduce new origin for Trait+'b
This helps us to preserve the existing errors.
2016-11-01 14:08:56 -04:00