Commit Graph

70208 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
gaurikholkar
ef275d1c10 update let-expressions to use except 2017-11-14 21:01:08 +05:30
Michael Woerister
4bfab89aa2 incr.comp.: Store the query result index which records where query results can be found in the cached. 2017-11-14 16:15:45 +01:00
Ariel Ben-Yehuda
c0f7cce96e check_unsafety: fix unused unsafe block duplication
The duplicate error message is later removed by error message
deduplication, but it still appears on beta and is still a bug
2017-11-14 16:38:34 +02:00
Michael Lamparski
4d200f6954 un-add some notes from tests 2017-11-14 09:25:09 -05:00
Michael Woerister
2087d5ebfa incr.comp.: Do some verification on data decoded from incr. comp. cache. 2017-11-14 14:50:03 +01:00
bors
9cd994cdc1 Auto merge of #45896 - malbarbo:use-libc-const, r=alexcrichton
Use getrandom syscall for all Linux and Android targets.

I suppose we can use it in all Linux and Android targets. In function `is_getrandom_available` is checked if the syscall is available (getrandom syscall was add in version 3.17 of Linux kernel), if the syscall is not available `fill_bytes` fallback to reading from `/dev/urandom`.

Update libc to include getrandom related constants.
2017-11-14 13:46:19 +00:00
Michael Woerister
de0317e267 incr.comp.: Encode DefPathTables for reconstructing DefIds. 2017-11-14 14:40:56 +01:00
Shotaro Yamada
a1f7bad4a7 Fix test 2017-11-14 22:29:09 +09:00
Michael Lamparski
dcbedf78a0 Add context to E0084, E00517, E0518
Show both the attribute and the item
2017-11-14 08:24:28 -05:00
Michael Woerister
bedb44cca8 incr.comp.: Allow for mapping from prev-session-CrateNums to current-session-CrateNums in OnDiskCaches. 2017-11-14 14:07:12 +01:00
Marco A L Barbosa
8f2dfd16dc Update libc (new const definitions for Linux sparc64) 2017-11-14 10:47:04 -02:00
steveklabnik
3b32a3a104 link the cargo book into the bookshelf 2017-11-14 06:51:59 -05:00
steveklabnik
623886f44c Start shipping the Cargo book
Fixes #44910
Fixes #39588

See both of those bugs for more details.
2017-11-14 06:51:59 -05:00
Michael Woerister
15db1652f8 incr.comp.: Implement TyDecoder for on_disk_cache::CacheDecoder. 2017-11-14 12:03:57 +01:00
kennytm
838a38365d
Fixed several pulldown warnings when documenting libstd. 2017-11-14 17:22:57 +08:00
Shotaro Yamada
ec2ff8f734 Add TyCtxt::is_closure 2017-11-14 17:43:43 +09:00
Shotaro Yamada
c3ec175857 Make create_temp_necessary a method 2017-11-14 17:12:08 +09:00
Shotaro Yamada
cc36f88ed4 Handle closures correctly in MIR inlining 2017-11-14 17:12:08 +09: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
Djzin
5b1cc1d810 don't send block back to be marked unreachable twice 2017-11-14 06:59:56 +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
Djzin
c503fe1134 add optimization codegen tests 2017-11-14 06:33:39 +00:00
Djzin
aed0c9c9c0 use lazy cached unreachable block - assign it to the function's closing brace 2017-11-14 06:33:39 +00:00
Djzin
829b70330e always add an unreachable branch on matches to give more info to llvm about which values are possible 2017-11-14 06:33:39 +00: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
Ariel Ben-Yehuda
824b307ff7 avoid the pprust infrastructure in macro expansion
This changes macro expansion to format the path of a macro directly
instead of usng the pprust infrastructure. The pprust infrastructure
tries to perform line-breaking in a slow fashion, which is undesired
when formatting the path of a macro.

This should to speed up expansion by a fair amount (I saw 20% on a
profiler on `rustc_mir`, and 50% of the time marked as "expansion" in
the profiler/time-passes is actually spent loading dependencies).
2017-11-14 01:24:36 +02: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
Aaron Power
e0ac8647b6
Update RELEASES.md 2017-11-13 21:48:01 +00: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
Michael Woerister
3bd333c988 incr.comp.: Add CacheEncoder for encoding query results into the incr.comp. cache. 2017-11-13 16:35:51 +01:00
gaurikholkar
39f468e668 fixing indentation 2017-11-13 20:19:54 +05:30
Michael Woerister
9ac102645f incr.comp.: Properly use ty::codec::decode_cnum() in rustc_metadata::decoder. 2017-11-13 15:48:52 +01:00
Michael Woerister
bc96d9d8c9 incr.comp.: Implement UseSpecializedXXcodable for DefIndex and DefId. 2017-11-13 15:46:46 +01:00