Commit Graph

69642 Commits

Author SHA1 Message Date
Guillaume Gomez
0895347a49 Rollup merge of #45970 - GuillaumeGomez:from-str-docs, r=QuietMisdreavus
Add missing links in FromStr docs

r? @QuietMisdreavus
2017-11-14 16:52:13 +01:00
Guillaume Gomez
01e979f7b1 Rollup merge of #45967 - matthewjasper:array-move-types, r=arielb1
MIR-borrowck: don't ICE for cannot move from array error

Closes #45694
compile-fail test E0508 now gives
```text
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array (Ast)
  --> .\src\test\compile-fail\E0508.rs:18:18
   |
18 |     let _value = array[0];  //[ast]~ ERROR E0508
   |                  ^^^^^^^^
   |                  |
   |                  cannot move out of here
   |                  help: consider using a reference instead: `&array[0]`

error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array (Mir)
  --> .\src\test\compile-fail\E0508.rs:18:18
   |
18 |     let _value = array[0];  //[ast]~ ERROR E0508
   |                  ^^^^^^^^ cannot move out of here

error: aborting due to 2 previous errors
```
2017-11-14 16:52:12 +01:00
Guillaume Gomez
529bb320f7 Rollup merge of #45961 - dereckson:unix-agnosticity-ci, r=Mark-Simulacrum
Use #!/usr/bin/env as shebang for Bash scripts

On some systems, the bash command could be available in another
directory than /bin. As such, to offer an env shebang is more
convenient.

This make sense even for docker scripts, as you can use Docker
on FreeBSD or SmartOS for example.
2017-11-14 16:52:11 +01:00
Guillaume Gomez
d0b11b9bd1 Rollup merge of #45950 - fitzgen:update-unary-and-binary-exprs-test-to-use-incr-except, r=michaelwoerister
incr: Make `unary_and_binary_exprs.rs` use `except`-style incremental checking

Part of #44924

r? @michaelwoerister
2017-11-14 16:52:10 +01:00
Guillaume Gomez
c95ef0d9d5 Rollup merge of #45941 - gaurikholkar:master, r=nikomatsakis
update match-expressions.rs with DepNode labels

As a part of #44924, I have updated the match-expressions.rs. The PR has tests verified for the following dependency nodes for let-expressions

- MirValidated
- MirOptimized
- TypeCheckTables
- TypeOfItem
- GenericsOfItem
- PredicatesOfItem
- FnSignature

cc @michaelwoerister
r? @nikomatsakis
2017-11-14 16:52:09 +01:00
Guillaume Gomez
013cd5af86 Rollup merge of #45815 - QuietMisdreavus:happy-little-notices, r=GuillaumeGomez
rustdoc: tweak notes on ignore/compile_fail examples

Part of https://github.com/rust-lang/rust/issues/44927

This is a softening of these notices to mention *why* a given example has a given callout, rather then telling viewers to be careful with an example. It also changes the character used for these samples from a warning logo to a circle-i/information logo.

![image](https://user-images.githubusercontent.com/5217170/32464361-5fbb5d9e-c305-11e7-8482-ce71b97a54df.png)
2017-11-14 16:52:07 +01:00
bors
24840dab0b Auto merge of #45916 - eddyb:even-mirer-0, r=nikomatsakis
rustc_mir: hardcode pass list internally and remove premature pluggability.

Fixes #41712 by moving the MIR pass lists from `rustc_driver` to `rustc_mir`.
The application of the passes is done with the `rustc_mir::transform::run_passes` macro, which is public, as are all the passes AFAIK, and can be used to apply MIR passes outside of `rustc_mir`.

With the ability to override query providers through the `rustc_driver` (orthogonal to, and not included in this PR), custom drivers will be able to substitute the entire pass list if they want to.
**EDIT**: the aforementioned ability is added by #45944.

r? @nikomatsakis
2017-11-14 07:54:51 +00:00
Eduard-Mihai Burtescu
d6aa56f44e rustc: split off BodyOwnerKind from MirSource. 2017-11-14 08:54:27 +02:00
Eduard-Mihai Burtescu
c79e8f4d1d rustc: remove unused MirSource::GeneratorDrop. 2017-11-14 08:52:26 +02:00
Eduard-Mihai Burtescu
c5022f2f16 rustc_mir: drive passes directly with a macro. 2017-11-14 08:52:25 +02:00
Eduard-Mihai Burtescu
86206f22a0 rustc: move the MIR pass infrastructure and list to rustc_mir. 2017-11-14 08:52:25 +02:00
bors
b5a3ab2e81 Auto merge of #45915 - michaelwoerister:removed-nodes-in-try-mark-green, r=alexcrichton
incr.comp.: Don't crash in DepGraph::try_mark_green() when encountering a removed input node.

Fixes a small regression that was introduced in #45867.

r? @nikomatsakis
2017-11-14 05:30:34 +00:00
bors
9b53f0a662 Auto merge of #45909 - sinkuu:issue-45885, r=arielb1
Normalize inlined function in MIR inliner

Fixes #45885

r? @arielb1
2017-11-14 02:05:37 +00:00
bors
212d74f1e7 Auto merge of #45436 - zilbuz:issue-44837, r=nikomatsakis
MIR-borrowck: add permisson checks to `fn access_lvalue`

WIP : Some FIXME left and some broken tests.

Fix #44837
2017-11-13 23:36:07 +00:00
matthewjasper
a6824f18b8 Use the correct type for cannot move error 2017-11-13 22:40:22 +00:00
Guillaume Gomez
7e8fe9a63f Add missing links in FromStr docs 2017-11-13 23:25:52 +01:00
bors
e21df8020d Auto merge of #45903 - nrc:rustfmt-dist, r=alexcrichton
Distribute Rustfmt

r? @alexcrichton
2017-11-13 21:06:11 +00:00
Basile Desloges
cbad2e5720 mir-borrowck: Test for check_access_permissions() 2017-11-13 21:53:10 +01:00
Basile Desloges
37e08a5dca mir-borrowck: Check access permissions in access_lvalue() 2017-11-13 21:53:09 +01:00
Basile Desloges
0bb77bdb54 mir-borrowck: Move is_static_mut() to ty/utils.rs 2017-11-13 21:53:09 +01:00
QuietMisdreavus
02b3785f84 update codeblock-title test with new notice text 2017-11-13 11:44:19 -06:00
bors
8efbf7a4f0 Auto merge of #45890 - arielb1:self-first, r=eddyb
check::method - unify receivers before normalizing method signatures

Normalizing method signatures can unify inference variables, which can
cause receiver unification to fail. Unify the receivers first to avoid
that.

Fixes #36701.
Fixes #45801.
Fixes #45855.

r? @eddyb

beta-nominating because #43880 made this ICE happen in more cases (the code in that issue ICEs post-#43880 only, but the unit test here ICEs on all versions).
2017-11-13 17:42:13 +00:00
gaurikholkar
39f468e668 fixing indentation 2017-11-13 20:19:54 +05:30
Sébastien Santoro
de8c57cb24 Use #!/usr/bin/env as shebang for Bash scripts
On some systems, the bash command could be available in another
directory than /bin. As such, to offer an env shebang is more
convenient.

This make sense even for docker scripts, as you can use Docker
on FreeBSD or SmartOS for example.
2017-11-13 14:33:12 +00:00
bors
aca22a8f81 Auto merge of #45824 - dotdash:stack_pop, r=alexcrichton
Update LLVM to fix miscompiles with -Copt-level=z on Windows

Fixes #45034
2017-11-13 14:20:15 +00:00
bors
b7ccb0a5a7 Auto merge of #45810 - SimonSapin:ac-dc, r=aturon
Disable LLVM assertions on Nightly, enable them in "alt" builds.

Per IRC discussion https://mozilla.logbot.info/rust-infra/20171106#c13812170-c13812204

Background: https://internals.rust-lang.org/t/disabling-llvm-assertions-in-nightly-builds/5388/14
2017-11-13 11:46:55 +00:00
bors
e312c8a8c3 Auto merge of #45956 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

- Successful merges: #45828, #45892, #45893, #45914, #45917, #45927, #45933, #45952, #45954
- Failed merges:
2017-11-13 09:13:00 +00:00
kennytm
48d2627c38 Rollup merge of #45954 - udoprog:fix-style, r=kennytm
Fix style in interner test
2017-11-13 17:09:48 +08:00
kennytm
8c9d500b19 Rollup merge of #45952 - zackmdavis:singular_projection, r=estebank
deduplicate projection error (E0271) messages

The `ErrorId` variant takes a u16 so that `DiagnosticMessageId` can retain
its `Copy` status (the present author's first choice having been the "EXXX"
code as a string).

The duplicated "type mismatch resolving `{}`" literal is unfortunate, but
the `struct_span_err!` macro (which we want to mark that error code as
used) is fussy about taking a literal, and the one-time-diagnostics set
needs an owned string.

This is concerning #33941 and probably #45805!

r? @estebank
2017-11-13 17:09:47 +08:00
kennytm
3604737b95 Rollup merge of #45933 - shanavas786:refactor-filter, r=alexcrichton
Refactor Option::filter method
2017-11-13 17:09:46 +08:00
kennytm
574dff9052 Rollup merge of #45927 - sinkuu:mir-borrowck-closure, r=estebank
MIR-borrowck: fix diagnostics for closures

Emit notes for captured variables in the same manner as AST borrowck.

```
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
  --> $DIR/borrowck-closures-two-mut.rs:24:24
   |
23 |     let c1 = to_fn_mut(|| x = 4);
   |                        -- - previous borrow occurs due to use of `x` in closure
   |                        |
   |                        first mutable borrow occurs here
24 |     let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
   |                        ^^ - borrow occurs due to use of `x` in closure
   |                        |
   |                        second mutable borrow occurs here
25 | }
   | - first borrow ends here

error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
  --> $DIR/borrowck-closures-two-mut.rs:24:24
   |
23 |     let c1 = to_fn_mut(|| x = 4);
   |                        -- - previous borrow occurs due to use of `x` in closure
   |                        |
   |                        first mutable borrow occurs here
24 |     let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
   |                        ^^ - borrow occurs due to use of `x` in closure
   |                        |
   |                        second mutable borrow occurs here
25 | }
   | - first borrow ends here
```

Fixes #45362.
2017-11-13 17:09:45 +08:00
kennytm
5d9b63ce7f Rollup merge of #45917 - ollie27:compiletest_stamp, r=alexcrichton
compiletest: Fix a couple of test re-run issues

* Re-run rustdoc tests if rustdoc or htmldocck.py was updated.
* Put stamp files in the correct subdirectories to avoid clashes when
the file names match but the subdirectory doesn't.
2017-11-13 17:09:44 +08:00
kennytm
e349b18150 Rollup merge of #45914 - michaelwoerister:fix-test-header-parsing, r=alexcrichton
Fix test case header parsing code in presence of multiple revisions.

The previous code would parse the TestProps, and then parse them again with a revision set, adding some elements (like aux_builds) a second time to the existing TestProps.
2017-11-13 17:09:43 +08:00
kennytm
331862ef11 Rollup merge of #45893 - redox-os:futex_timeout, r=alexcrichton
Redox: Use futex timeout to implement CondVar::wait_timeout

`CondVar::wait_timeout` is implemented by supplying a `TimeSpec` pointer to `futex`. In addition, all calls to `unimplemented!()` have been removed from the Redox `sys` module.

Related to https://github.com/rust-lang/rust/pull/45892
2017-11-13 17:09:42 +08:00
kennytm
563af5d260 Rollup merge of #45892 - redox-os:is_absolute_fix, r=alexcrichton
Redox: Return true from Path::is_absolute if a Path contains root or a scheme

In Redox, different subsystems have different filesystem paths. However, the majority of applications using the `Path::is_absolute` function really only want to know if a path is absolute from the perspective of the scheme it is currently running in, usually `file:`. This makes both `file:/` and `/` return `true` from `Path::is_absolute`, meaning that most code does not have to check if it is running on Redox.

Code that wants to know if a path contains a scheme can implement such a check on its own.

Related to https://github.com/rust-lang/rust/pull/45893
2017-11-13 17:09:41 +08:00
kennytm
e3ca816d36 Rollup merge of #45828 - pornel:printoption, r=nrc
Remove deprecated message

Follow up of #43067
2017-11-13 17:09:40 +08:00
John-John Tedro
b8891eebe4 Fix style in interner test 2017-11-13 07:55:20 +01:00
bors
c8c1424bf4 Auto merge of #45673 - GuillaumeGomez:rustdoc-type-search-generic, r=QuietMisdreavus
Search over generic types in docs

This is what I was talking about @QuietMisdreavus. Now we have generics.

Waiting for #45617 to get merged.
2017-11-13 06:54:24 +00:00
Zack M. Davis
5cc488d250 deduplicate projection error (E0271) messages
The `ErrorId` variant takes a u16 so that `DiagnosticMessageId` can retain
its `Copy` status (the present author's first choice having been the "EXXX"
code as a string).

The duplicated "type mismatch resolving `{}`" literal is unfortunate, but
the `struct_span_err!` macro (which we want to mark that error code as
used) is fussy about taking a literal, and the one-time-diagnostics set
needs an owned string.

This is concerning #33941 and probably #45805!
2017-11-12 19:34:27 -08:00
Shotaro Yamada
f99142b977 Fix comments 2017-11-13 12:25:13 +09:00
bors
783c6ec55d Auto merge of #45949 - Mark-Simulacrum:cargo-next, r=alexcrichton
Bump cargo to master

Includes a few bugfixes, and updates the Cargo book.

Critically includes https://github.com/rust-lang/cargo/pull/4716. This
unblocks (in theory) crater runs.
2017-11-13 01:53:12 +00:00
Nick Fitzgerald
c9c7d9f57a incr: Make unary_and_binary_exprs.rs use except-style incremental checking
Part of #44924
2017-11-12 16:12:29 -08:00
bors
7f43981ebf Auto merge of #45623 - mneumann:dragonfly-ci, r=alexcrichton
Add ci for DragonFly
2017-11-12 23:31:58 +00:00
Mark Simulacrum
1f921ec9cf Bump cargo to master.
Includes a few bugfixes, and updates the Cargo book.

Critically includes https://github.com/rust-lang/cargo/pull/4716. This
unblocks (in theory) crater runs.
2017-11-12 16:21:00 -07:00
Nick Cameron
97d21e29df review changes 2017-11-13 10:51:30 +13:00
Nick Cameron
63d854acf2 Distribute Rustfmt 2017-11-13 10:51:29 +13:00
bors
79cfce3d35 Auto merge of #44167 - cengizIO:master, r=nikomatsakis
Improve SubSupConflict with a named and an anonymous lifetime parameter #42701

Hello!

This fixes #42701.

## UPDATE 01
Tests are producing different results between different env builds.
This inconsistency might take a long time to investigate and fix. So, be patient

## UPDATE 02
Changed an `FxHashMap` with a `BTreeMap`. Inconsistency seems to be resolved for now.
2017-11-12 21:04:41 +00:00
Guillaume Gomez
0e4c829f2b Add "As parameters" items as well 2017-11-12 21:38:24 +01:00
Guillaume Gomez
5c5ab0d1fb Improve result output 2017-11-12 21:38:24 +01:00
Guillaume Gomez
6514f44bd1 Big JS optimization 2017-11-12 21:38:23 +01:00