Commit graph

65400 commits

Author SHA1 Message Date
Niko Matsakis
1db58d7fa5 rename Binder::new_not_binding to Binder::dummy
per pnkfelix's suggestion
2017-12-07 05:28:04 -05:00
Niko Matsakis
47037705dc add test comparing free region to bound region
suggested by arielb1
2017-12-07 05:28:04 -05:00
Niko Matsakis
86e7b5c12a use -Znll -Zborrowck=mir -Zverbose consistently 2017-12-07 05:28:04 -05:00
Niko Matsakis
75cf482651 region-ebr-does-not-outlive-static: reuse old test instead 2017-12-07 05:28:04 -05:00
Niko Matsakis
b8e9eaf3ae propagate-approximated-ref: include FIXME comment 2017-12-07 05:28:03 -05:00
Niko Matsakis
2a17b9390b test more failure cases for approximating the "longer" side
as suggested by arielb1
2017-12-07 05:28:03 -05:00
Niko Matsakis
ca60826110 test approximations of the "shorter side" that resort to 'static
This includes the additional case suggested by arielb1.
2017-12-07 05:28:03 -05:00
Niko Matsakis
3c42f18c37 delete stray file 2017-12-07 05:28:03 -05:00
Niko Matsakis
6ee31e2af7 escape-upvar-ref: patch comment per arielb1 2017-12-07 05:28:03 -05:00
Niko Matsakis
8b657d378e escape-upvar-nested: patch "dangling reference" to renamed test 2017-12-07 05:28:02 -05:00
Niko Matsakis
782b9f5c0a escape-argument: improve comment per arielb1's suggestion 2017-12-07 05:28:02 -05:00
Niko Matsakis
dac59ac93a escape-argument-callee: improve comment per arielb1's suggestions 2017-12-07 05:28:02 -05:00
Niko Matsakis
05977fe751 rewrite comment on how to get closure sig, per arielb1's suggestion 2017-12-07 05:28:02 -05:00
Niko Matsakis
47b8ef51d4 don't print self symbol's internal index unless gensymed
It's just not useful. It also makes it hard to have tests that probe
internal state, since the interning number is very sensitive.

Dumping the number in the case of gensym is not ideal but will do for
now.
2017-12-07 05:28:01 -05:00
Niko Matsakis
681f54f795 fix filter to support & and | 2017-12-07 05:28:01 -05:00
Niko Matsakis
b4d71ea6f8 make fn_sig().subst() ICE when used with a closure
It's inefficient, and the substitution there doesn't account for the
extra regions used by NLL inference, so it's a bad thing to encourage.

As it happens all callers already know if they have a closure or not,
from what I can tell.
2017-12-07 05:28:01 -05:00
Niko Matsakis
d5ef3e262f replace InferCtxt::fn_sig with closure_sig 2017-12-07 05:28:01 -05:00
Niko Matsakis
05441abd2b add closure requirement tests, improve debugging output
The overall format is now easier to read. Also, There is now graphviz
output, as well as a `#[rustc_regions]` annotation that dumps internal
state.
2017-12-07 05:28:00 -05:00
Niko Matsakis
ab1c1bc6bc mir-borrowck returns closure requirements, mir-typeck enforces 2017-12-07 05:28:00 -05:00
Niko Matsakis
2ec959fc35 extend MIR dump with detailed, extra information 2017-12-07 05:27:58 -05:00
Niko Matsakis
e5dc4ba280 renumber types in ty::Const and relate them to mir::Constant 2017-12-07 05:27:03 -05:00
bors
bb1bd88ec3 Auto merge of #46221 - GuillaumeGomez:doc-script-load-speedup, r=nrc
Speedup search loading when search url is received

Fixes #45971.

r? @nrc

cc @rust-lang/docs
2017-12-07 09:47:01 +00:00
est31
6dba3e68e6 Migrate even more feature gate tests to ui
We also rename some of the files to conform to the
feature-gate-<feat_name>.rs pattern that is most common.
2017-12-07 10:14:41 +01:00
est31
38438c618c Migrate a few feature gate tests to ui
Renames only in this commit, and obviously
.stderr file additions.
2017-12-07 10:14:39 +01:00
est31
8ba9f9ecf0 Tidy: allow feature-gate tests to be ui tests
ui tests are the future, especially since the
recent improvement where we have gained
checking and requiring of //~ERROR comments.

The tidy feature-gate test check is intended
to be 50% an actual insurance that there is
a check, and 50% to be a teacher that such
checks are required.

With this commit applied, newbies might
interpret stuff wrongly and create tests
that don't fail but succeed instead.

This is not what feature gate tests are
for though. Therefore, in a later step,
when only ui tests are allowed to be feature
gate tests, we will add checking to ensure
that a file marked as gate test is actually
required to be a compilation failure.

Right now implementing such a check is a
bit annoying as one needs to only do it
when the compile-fail test is in the
ui test suite :/.
2017-12-07 10:11:21 +01:00
Agustin Chiappe Berrini
29e2680602 remove unnecessary change 2017-12-07 04:01:59 -05:00
Agustin Chiappe Berrini
dd41929509 remove unused test 2017-12-07 04:00:22 -05:00
Agustin Chiappe Berrini
8647b9da48 remove unnecessary changes 2017-12-07 03:58:44 -05:00
Agustin Chiappe Berrini
fb8ab18f50 remove unnecessary function 2017-12-07 03:56:31 -05:00
Agustin Chiappe Berrini
ce1fed7f52 address comments 2017-12-07 03:52:25 -05:00
bors
7b637b778d Auto merge of #46187 - notriddle:patch-1, r=QuietMisdreavus
Rename C-like enum to Field-less enum

There is no need to reference the C programming language to explain this concept.
2017-12-07 07:16:44 +00:00
bors
bd7021fd57 Auto merge of #46533 - nikomatsakis:ui-stamp-files, r=alexcrichton
compiletest: account for `ui` reference files when deciding to skip

The stamp files for compiletest were ignoring `.stderr` and `.stdout` files. This was driving me crazy.

r? @alexcrichton
2017-12-07 04:46:16 +00:00
bors
d516d5dff7 Auto merge of #46528 - CensoredUsername:stabilize_abi_sysv64, r=arielb1
Stabilize abi_sysv64

Closes #36167, stabilizing the use of the "sysv64" ABI on x64 platforms where it is not the default ABI.

FCP on this is complete in the tracking issue.
2017-12-07 02:13:13 +00:00
Jonathan Strong
9307917d6a Adds language to the documentation for Option and Result suggesting
the use of lazily evaluated alternatives when appropriate. These
comments are intended to echo a clippy lint on the same topic (see
https://rust-lang-nursery.github.io/rust-clippy/master/index.html#or_fun_call)
2017-12-06 20:30:57 -05:00
bors
061bdb5c12 Auto merge of #46524 - eddyb:static-static, r=arielb1
rustc_mir: promote references of statics from other statics.

Fixes #46522 by also allowing `STATIC_REF` in MIR const-qualification, not just AST rvalue promotion.
2017-12-06 23:42:17 +00:00
Eduard-Mihai Burtescu
292c6ac57f rustc_mir: promote references of statics from other statics. 2017-12-07 01:18:34 +02:00
bors
5a2465e2b4 Auto merge of #45953 - estebank:tab-4, r=nikomatsakis
Display `\t` in diagnostics code as four spaces

Follow up to #44386 using the unicode variable width machinery from #45711 to replace tabs in the source code when displaying a diagnostic error with four spaces (instead of only one), while properly accounting for this when calculating underlines.

Partly addresses #44618.
2017-12-06 21:05:53 +00:00
bors
cf30759a84 Auto merge of #46268 - arielb1:union-borrow, r=nikomatsakis
MIR borrowck: implement union-and-array-compatible semantics

Fixes #44831.
Fixes #44834.
Fixes #45537.
Fixes #45696 (by implementing DerefPure semantics, which is what we want going forward).

r? @nikomatsakis
2017-12-06 18:30:15 +00:00
Michael Howell
a126a732eb
Fix overlong line length 2017-12-06 10:54:50 -07:00
Michael Howell
d6ba2e4d1c
Fix dangling close paren 2017-12-06 10:54:03 -07:00
Niko Matsakis
7b456c053c pacify the mercilous tidy 2017-12-06 09:42:09 -05:00
Corey Farwell
bb239e294e Rollup merge of #46512 - Havvy:doc-compile_fail, r=kennytm
Give compile_error macro examples

I cannot get Rust to build at all with it complaining about GCC not being a valid C compiler or something, so letting TravisCI be my tester...

Fixes #46171
2017-12-06 09:35:41 -05:00
Corey Farwell
872c0259b6 Rollup merge of #46502 - GuillaumeGomez:improve-search-style, r=QuietMisdreavus
Improve search style

Fixes #46494.

r? @QuietMisdreavus
2017-12-06 09:35:40 -05:00
Corey Farwell
4a0647d1f9 Rollup merge of #46483 - frewsxcv:frewsxcv-ptr-swap, r=BurntSushi
Document behavior of `ptr::swap` with overlapping regions of memory.

Fixes https://github.com/rust-lang/rust/issues/44479.
2017-12-06 09:35:38 -05:00
Corey Farwell
e5fd52bed2 Rollup merge of #46431 - steveklabnik:gh42725, r=QuietMisdreavus
Mention the name of ? in Result's docs

Fixes #42725

or at least, this is the best we can really do. #35946 is tracking
better errors already, so that should cover the other part of it.
2017-12-06 09:35:37 -05:00
Corey Farwell
f5e4aa2a80 Rollup merge of #46378 - udoprog:benches-rand, r=kennytm
Fix use of rand in liballoc benches
2017-12-06 09:35:36 -05:00
Corey Farwell
b5f11da0ac Rollup merge of #46136 - tbu-:pr_werror, r=nikomatsakis
Clarify what `-D warnings` or `-F warnings` does

They set all lints currently on the warning level to `deny` or `forbid`,
respectively.
2017-12-06 09:35:35 -05:00
Simon Sapin
1cf11b3d0b Rename fs::read_utf8 to read_string 2017-12-06 14:10:51 +01:00
Niko Matsakis
8681290240 compiletest: account for ui reference files when deciding to skip 2017-12-06 06:31:10 -05:00
Niko Matsakis
a4cafe46c2 runtest: rustfmt 2017-12-06 06:20:58 -05:00
bors
632ad19135 Auto merge of #46192 - arielb1:locally-coherent, r=nikomatsakis
coherence: fix is_knowable logic

A trait-ref that passes the orphan-check rules can still be implemented in a crate downstream from our crate (for example, `LocalType for LocalTrait<_>` might be matched by a `LocalType for LocalTrait<TypeFromDownstreamCrate>`), and this should be known by the `is_knowable`  logic.

Trait selection had a hackfix for this, but it's an hacky fix that does not handle all cases. This patch removes it.

fixes #43355.

r? @nikomatsakis

Needs a crater run
2017-12-06 10:36:09 +00:00
Agustin Chiappe Berrini
65ccf24ce8 and refactor to just move the checking 2017-12-06 04:28:01 -05:00
bors
a62910baca Auto merge of #46521 - SimonSapin:uninhabited-variants, r=eddyb
rustc_trans: don't write discriminants for uninhabited variants

Fixes #46519.

Patch as suggested by eddyb: https://github.com/rust-lang/rust/issues/46519#issuecomment-349443519
2017-12-06 08:01:14 +00:00
bors
6a5895c433 Auto merge of #46530 - nrc:rls-update, r=alexcrichton
Update rls and rustfmt and set them testing

r? @alexcrichton
2017-12-06 05:29:39 +00:00
Nick Cameron
36c380292c Update Cargo 2017-12-06 18:21:14 +13:00
Nick Cameron
75029259b3 Update rls and rustfmt 2017-12-06 18:18:44 +13:00
bors
d10b04d3df Auto merge of #45898 - JRegimbal:master, r=QuietMisdreavus
Change "Types/modules" title of search tab to be more accurate

From issue #45787. Used "In name" as per suggestion from @Seeker14491.
2017-12-06 03:02:17 +00:00
CensoredUsername
d68d127875 Stabilize abi_sysv64 2017-12-06 01:19:35 +01:00
Ariel Ben-Yehuda
9d3558725b work around weird match arm lifetimes 2017-12-06 02:10:24 +02:00
Jeff Crocker
3f0cc7caca
Format function interface fingerprint hash tests 2017-12-05 15:27:14 -08:00
Jeff Crocker
104ebd2c43
Update 'while loop' fingerprint hash tests 2017-12-05 15:01:49 -08:00
Jeff Crocker
b8714c6040
Update 'while let loop' fingerprint hash tests 2017-12-05 14:57:35 -08:00
Ariel Ben-Yehuda
66c032cb2d more comments 2017-12-06 00:51:47 +02:00
Jeff Crocker
3f48cbb455
Update loop expression fingerprint hash tests 2017-12-05 14:50:54 -08:00
Simon Sapin
d4fabb987b rustc_trans: don't write discriminants for uninhabited variants
Fixes #46519.

Patch as suggested by eddyb:
https://github.com/rust-lang/rust/issues/46519#issuecomment-349443519
2017-12-05 23:50:41 +01:00
Jeff Crocker
820ed30a85
Update inline asm fingerprint hash tests 2017-12-05 14:44:52 -08:00
Ariel Ben-Yehuda
425c2c3606 convert errors to warnings 2017-12-06 00:43:47 +02:00
Jeff Crocker
bc1754216d
Update function interface fingerprint hash tests 2017-12-05 14:40:13 -08:00
JRegimbal
41df62ce29 Changed tab names to those agreed upon.
Tabs are "In Names", "In Parameters", and "In Return Types".
2017-12-05 17:39:50 -05:00
Ariel Ben-Yehuda
37df5e0b91 adjust libcore 2017-12-06 00:34:02 +02:00
Ariel Ben-Yehuda
6b9fbb2ab8 fix borrows across loops, libcore *almost* compiles 2017-12-06 00:34:02 +02:00
Ariel Ben-Yehuda
82f3fc5dbc fix handling of immutable variables 2017-12-06 00:34:02 +02:00
Ariel Ben-Yehuda
210f76816f handle gen/kill sets together 2017-12-06 00:34:01 +02:00
Ariel Ben-Yehuda
243c5a5faa fix handling of CallScopeData
This fixes the tests for issue #29793
2017-12-06 00:34:01 +02:00
Ariel Ben-Yehuda
cbcae7f694 improve conflict error reporting 2017-12-06 00:34:01 +02:00
Ariel Ben-Yehuda
f8c35d9e41 fix handling of consts in borrow-checking
I'm not sure how correct it this, but it gets whatever needs to compile
to compile.
2017-12-06 00:34:01 +02:00
Ariel Ben-Yehuda
87a8a70d0d MIR borrowck: avoid formatting state when it is not needed
This improves performance on large functions.
2017-12-06 00:34:01 +02:00
Ariel Ben-Yehuda
6bc4b50511 MIR borrowck: implement union-and-array-compatible semantics
Fixes #44831.
Fixes #44834.
Fixes #45537.
Fixes #45696 (by implementing DerefPure semantics, which is what we want
going forward).
2017-12-06 00:34:01 +02:00
Jeff Crocker
bf3246fa10
Update for loop fingerprint hash tests 2017-12-05 14:13:58 -08:00
Jeff Crocker
77aee18c13
Update closure expression fingerprint hash tests 2017-12-05 14:03:24 -08:00
Havvy
aaaea2c562 compile_error example blurbs 2017-12-05 14:01:09 -08:00
bors
cfba0d446e Auto merge of #46514 - zackmdavis:sticking_it_to_the_man, r=alexcrichton
template month/year, version into man pages while building dist tarball

![the_man](https://user-images.githubusercontent.com/1076988/33596149-963956f4-d94f-11e7-926f-e683217765e5.png)

This is meant to resolve #25689.

r? @alexcrichton
2017-12-05 20:08:10 +00:00
bors
abe85ab0b2 Auto merge of #46498 - malbarbo:dist-armv5te, r=alexcrichton
Add armv5te-unknown-linux-gnueabi to cross builder

This is the only linux target missing in the dist builders.
2017-12-05 17:28:31 +00:00
steveklabnik
893474ea6d Mention the name of ? in Result's docs
Fixes #42725

or at least, this is the best we can really do. #35946 is tracking
better errors already, so that should cover the other part of it.
2017-12-05 10:07:51 -05:00
Ariel Ben-Yehuda
1769c63dc1 add a comment and assertion explaining everything 2017-12-05 15:42:34 +02:00
Ariel Ben-Yehuda
9d38541d3f improve error reporting 2017-12-05 15:42:34 +02:00
Ariel Ben-Yehuda
2614cc51dd convert the new conflicts to a soft error 2017-12-05 15:42:33 +02:00
Ariel Ben-Yehuda
1271ea4f95 refactor a bit 2017-12-05 15:41:40 +02:00
Ariel Ben-Yehuda
38747dd3a7 improve treatment of local types in "remote coherence" mode 2017-12-05 15:41:40 +02:00
bors
bf2be6175e Auto merge of #46492 - eddyb:move-ops, r=arielb1
rustc_mir: don't move temporaries that are still used later.

This should unbreak using the MIR borrow-checker on `libcore` (assuming #46268 is merged).
2017-12-05 13:35:59 +00:00
Eduard-Mihai Burtescu
2a629f931d rustc_mir: don't move temporaries that are still used later. 2017-12-05 12:59:07 +02:00
Havvy
3f0b766c35 No unused macro warning in compile_error example. 2017-12-05 01:47:47 -08:00
Marco A L Barbosa
bea65d4041 Add armv5te-unknown-linux-gnueabi to cross builder 2017-12-05 07:46:24 -02:00
bors
a2899408dd Auto merge of #46503 - Aaron1011:librustdoc_log, r=Mark-Simulacrum
Remove librustdoc dependency on log

This change should have been included in PR #46386.

Since librustdoc doesn't explicitly depend on internal crates
(such as librustc_driver) through its Cargo.toml, it ends up using the
sysroot to resolve them. By removing the dependency on 'log',
we ensure that the syroot is used to resolve `log` as well. This ensures
that only one version of log is in use, so that `env_logger::init()`
enables all uses of `log!` macros.
2017-12-05 09:00:35 +00:00
Zack M. Davis
207fc0bb45 template month/year, version into man pages while building dist tarball
This is meant to resolve #25689.
2017-12-04 23:47:59 -08:00
bors
8921535289 Auto merge of #46499 - malbarbo:rename-cross, r=alexcrichton
Rename cross(2) builder to dist-various-{1,2}

Follows the convention of the other builders.
2017-12-05 06:28:29 +00:00
Havvy
44c343be45 Give compile_error macro examples 2017-12-04 21:55:24 -08:00
Corey Farwell
f3662275e4 Document behavior of ptr::swap with overlapping regions of memory.
Fixes https://github.com/rust-lang/rust/issues/44479.
2017-12-04 22:49:48 -05:00
bors
98a96b0b66 Auto merge of #46403 - oli-obk:generic_missing_impl, r=nikomatsakis
Report a targeted note for generic parameters that are missing a trait bound
2017-12-05 02:57:57 +00:00
bors
a4fa23a5bb Auto merge of #46305 - irinagpopa:backstory, r=alexcrichton,eddyb
Move rustc_back modules where they belong.
2017-12-05 00:21:59 +00:00
Aaron Hill
f6d3900642
Remove librustdoc dependency on log
This change should have been included in PR #46386.

Since librustdoc doesn't explicitly depend on internal crates
(such as librustc_driver) through its Cargo.toml, it ends up using the
sysroot to resolve them. By removing the dependency on 'log',
we ensure that the syroot is used to resolve `log` as well. This ensures
that only one version of log is in use, so that `env_logger::init()`
enables all uses of `log!` macros.
2017-12-04 17:16:19 -05:00
bors
cd8a352995 Auto merge of #46427 - michaelwoerister:transitive-svh, r=nikomatsakis
incr.comp.: Incorporate the stable commandline arg hash and SVHs of upstream crates into the SVH.

So far the SVH detected changes in the HIR, which is already very sensitive, but in order for `eval_always` queries to also be sensitive to changes in upstream crates, the SVH also needs to capture changes there.

This PR fixes [rust-icci/crossbeam](https://travis-ci.org/rust-icci/crossbeam/builds/308936448), but I have not yet been able to come up with a minimal regression test.

r? @nikomatsakis
2017-12-04 21:46:15 +00:00
Guillaume Gomez
611d0e6cce Improve search style 2017-12-04 22:11:21 +01:00
bors
8503b3ff82 Auto merge of #46319 - nikomatsakis:nll-master-to-rust-master-2, r=pnkfelix
NLL: improve inference with flow results, represent regions with bitsets, and more

This PR begins with a number of edits to the NLL code and then includes a large number of smaller refactorings (these refactorings ought not to change behavior). There are a lot of commits here, but each is individually simple. The goal is to land everything up to but not including the changes to how we handle closures, which are conceptually more complex.

The NLL specific changes are as follows (in order of appearance):

**Modify the region inferencer's approach to free regions.** Previously, for each free region (lifetime parameter) `'a`, it would compute the set of other free regions that `'a` outlives (e.g., if we have `where 'a: 'b`, then this set would be `{'a, 'b}`). Then it would mark those free regions as "constants" and report an error if inference tried to extend `'a` to include any other region (e.g., `'c`) that is not in that outlives set. In this way, the value of `'a` would never grow beyond the maximum that could type check. The new approach is to allow `'a` to grow larger. Then, after the fact, we check over the value of `'a` and see what other free regions it is required to outlive, and we check that those outlives relationships are justified by the where clauses in scope etc.

**Modify constraint generation to consider maybe-init.** When we have a "drop-live" variable `x` (i.e., a variable that will be dropped but will not be otherwise used), we now consider whether `x` is "maybe initialized" at that point. If not, then we know the drop is a no-op, and we can allow its regions to be dead. Due to limitations in the fragment code, this currently only works at the level of entire variables.

**Change representation of regions to use a `BitMatrix`.** We used to use a `BTreeSet`, which was rather silly. We now use a MxN matrix of bits, where `M` is the number of variables and `N` is the number of possible elements in each set (size of the CFG + number of free regions).

The remaining commits (starting from
extract the `implied_bounds` code into a helper function ") are all "no-op" refactorings, I believe.

~~One concern I have is with the commit "with -Zverbose, print all details of closure substs"; this commit seems to include some "internal" stuff in the mir-dump files, such as internal interner numbers, that I fear may vary by platform. Annoying. I guess we will see.~~ (I removed this commit.)

As for reviewer, @arielb1 has been reviewing the PRs, and they are certainly welcome to review this one too. But I figured it'd maybe be good to have more people taking a look and being familiar with this code, so I'll "nominate" @pnkfelix .

r? @pnkfelix
2017-12-04 19:07:52 +00:00
Marco A L Barbosa
79b47a1f26 Rename cross(2) builder to dist-various-{1,2}
Follows the convention of the other builders.
2017-12-04 16:38:19 -02:00
Niko Matsakis
a6adc74e87 adopt longer and shorter rather than fr and outlived_fr 2017-12-04 11:30:39 -05:00
Niko Matsakis
ab2bc9f073 outlives/env: fix comment, say must and not should 2017-12-04 11:30:38 -05:00
bors
226656ff72 Auto merge of #46463 - nak3:fix-invalid-docs-path, r=kennytm
Fix invalid docs path for compiler plugins

The path to the docs `src/doc/guide-plugin.md` moved to
`src/doc/unstable-book/src/language-features/plugin.md`.

This patch updates it in the comment of WARNING message of the test
code.
2017-12-04 16:29:28 +00:00
Irina-Gabriela Popa
2c175df013 rustc_back: replace tempdir with crates.io version. 2017-12-04 18:25:31 +02:00
Irina-Gabriela Popa
dda924ab6a rustc_back: move dynamic_lib to rustc_metadata. 2017-12-04 18:25:29 +02:00
Irina-Gabriela Popa
d6f70359dc rustc_back: remove slice module in favor of std::slice::from_ref. 2017-12-04 18:25:06 +02:00
Niko Matsakis
271616088f transtive_relation: fix typo in comment for parents 2017-12-04 10:46:35 -05:00
Niko Matsakis
7409ffd17e outlives/env: Fix comment that lost surrounding context. 2017-12-04 10:42:46 -05:00
Niko Matsakis
a3935961f0 region_infer: Fix typo in comment 2017-12-04 10:36:54 -05:00
Niko Matsakis
14480b401a free_region_map: Fix typo in comment: r_a <= r_b 2017-12-04 10:36:38 -05:00
Niko Matsakis
c1708abb07 type_check.rs: rustfmt 2017-12-04 09:14:39 -05:00
Niko Matsakis
506e80c899 remove unused span from eq_types (and rustfmt slightly) 2017-12-04 09:14:39 -05:00
Niko Matsakis
18cc0f9f37 document closure_base_def_id 2017-12-04 09:14:38 -05:00
Niko Matsakis
2e63bb3419 fix debruijn account in for_each_free_region 2017-12-04 09:14:38 -05:00
Niko Matsakis
243bf3f718 rename "free region" to "universally quantified region"
This has been bugging me. All the regions appear free in the source;
the real difference is that some of them are universally quantified
(those in the function signature) and some are existentially
quantified (those for which we are inferring values).
2017-12-04 09:14:38 -05:00
Niko Matsakis
fa813f74a2 introduce closure_env_ty helper to compute ty of closure env arg
Previously the code was somewhat duplicated.
2017-12-04 09:14:38 -05:00
Niko Matsakis
7f247add41 move liberate_late_bound_regions to a method on the tcx
No reason for it to live on `Inherited`.
2017-12-04 09:14:37 -05:00
Niko Matsakis
e9067bd5cc MIR dump: restructure pretty to be more extensible by other code 2017-12-04 09:14:37 -05:00
Niko Matsakis
49d2274cfe constraint_generation: create liveness constraints more thoroughly
We now visit just the stuff in the CFG, and we add liveness
constraints for all the random types, regions etc that appear within
rvalues and statements.
2017-12-04 09:14:35 -05:00
Niko Matsakis
4de7336862 extend TransitiveRelation with parents function 2017-12-04 08:51:14 -05:00
Niko Matsakis
663e7a4f08 promote region_infer into its own module 2017-12-04 08:51:13 -05:00
Niko Matsakis
fb4b06ab3b rename greater_than to reachable_from 2017-12-04 08:51:13 -05:00
Niko Matsakis
45f6027196 break type-checking of aggregate-kind out into helper function 2017-12-04 08:51:13 -05:00
Niko Matsakis
31d61f1f86 rename implied_bounds module to bounds 2017-12-04 08:51:13 -05:00
Niko Matsakis
c45307fae1 extract the code to create OutlivesBounds into its own module
Now it can be reused by the NLL code.
2017-12-04 08:51:13 -05:00
Niko Matsakis
1f33145ae9 make no_late_bound_regions a method on Binder<T> 2017-12-04 08:51:12 -05:00
Niko Matsakis
5562663a6c make resolve_regions_and_report_errors take an OutlivesEnv
This revealed some shortcomings, one of which is fixed. Fixes #45937.
2017-12-04 08:51:12 -05:00
Niko Matsakis
abd7d88139 move free_regions_map into infer::outlives 2017-12-04 08:51:12 -05:00
Niko Matsakis
aa51603870 extract the implied_bounds code into a helper function 2017-12-04 08:51:12 -05:00
Zack M. Davis
22b31758ec region_infer: BitMatrix representation of region values
This should be more efficient than allocating two BTreeSets for every
region variable?—as it is written in #45670.
2017-12-04 08:51:11 -05:00
Paul Daniel Faria
a9cb25b23a inform constraint generation using maybe-init
In particular, if we see a variable is DROP-LIVE, but it is not
MAYBE-INIT, then we can ignore the drop. This leavess attempt to use
more complex refinements of the idea (e.g., for subpaths or subfields)
to future work.
2017-12-04 08:51:11 -05:00
Niko Matsakis
08c8d7e919 borrow_check.rs: rustfmt 2017-12-04 08:51:10 -05:00
Kenjiro Nakayama
3e46fa2c9a Fix invalid docs path for compiler plugins 2017-12-04 22:39:39 +09:00
Niko Matsakis
a96b0cf86d replace constant regions with a post-inference check
Rather than declaring some region variables to be constant, and
reporting errors when they would have to change, we instead populate
each free region X with a minimal set of points (the CFG plus end(X)),
and then we let inference do its thing. This may add other `end(Y)`
points into X; we can then check after the fact that indeed `X: Y`
holds.

This requires a bit of "blame" detection to find where the bad
constraint came from: we are currently using a pretty dumb
algorithm. Good place for later expansion.
2017-12-04 08:25:21 -05:00
Niko Matsakis
932452ecc7 separate out the liveness constraints from the final value
It will be useful later for diagnostics to be able to remember where
things were live.
2017-12-04 08:25:20 -05:00
bors
1a8282a9b4 Auto merge of #46486 - scottmcm:i128-target-option, r=nagisa
Add an i128_lowering flag in TargetOptions

Not actually enabled by default anywhere yet.

r? @nagisa

cc #45676 @est31
2017-12-04 12:38:27 +00:00
bors
c16f480fa6 Auto merge of #46485 - khuey:cursor-read_exact, r=Manishearth
Add a specialization of read_exact for Cursor.

The read_exact implementation for &[u8] is optimized and usually allows LLVM to reduce a read_exact call for small numbers of bytes to a bounds check and a register load instead of a generic memcpy.  On a workload I have that decompresses, deserializes (via bincode), and processes some data, this leads to a 40% speedup by essentially eliminating the deserialization overhead entirely.
2017-12-04 10:02:48 +00:00
Scott McMurray
1bc402fd80 Add an i128_lowering flag in TargetOptions
Not actually enabled by default anywhere yet.
2017-12-03 21:53:48 -08:00
Kyle Huey
02c1862fb5 Add a specialization of read_exact for Cursor.
The read_exact implementation for &[u8] is optimized and usually allows LLVM to reduce a read_exact call for small numbers of bytes to a bounds check and a register load instead of a generic memcpy.  On a workload I have that decompresses, deserializes (via bincode), and processes some data, this leads to a 40% speedup by essentially eliminating the deserialization overhead entirely.
2017-12-03 20:45:12 -08:00
bors
fdfbcf85d5 Auto merge of #46482 - frewsxcv:rollup, r=frewsxcv
Rollup of 8 pull requests

- Successful merges: #45957, #46260, #46432, #46442, #46454, #46462, #46465, #46473
- Failed merges:
2017-12-03 23:02:40 +00:00
Corey Farwell
48d38555e5 Rollup merge of #46473 - frewsxcv:frewsxcv-param-name, r=TimNN
Consistent parameter name for numeric ‘checked’ operations.

Some checked operations use `rhs` as a parameter name, and some use
`other`. For the sake of consistency, unify everything under the `rhs`
name.

Fixes https://github.com/rust-lang/rust/issues/46308.
2017-12-03 17:43:50 -05:00
Corey Farwell
909a8de953 Rollup merge of #46465 - nak3:fix-invalid-link, r=kennytm
Fix invalid link to lint_plugin_test.rs

The path to `lint_plugin_test.rs` was moved to `src/test/ui-fulldeps/`
from `src/test/run-pass-fulldeps/` in 38ef85696d

This patch updates it in the docs.
2017-12-03 17:43:49 -05:00
Corey Farwell
94dbbacd45 Rollup merge of #46462 - sinkuu:copyprop_reg2, r=arielb1
Fix CopyPropagation regression (2)

Remaining part of MIR copyprop regression by (I think) #45380, which I missed in #45753.

```rust
fn foo(mut x: i32) -> i32 {
    let y = x;
    x = 123; // `x` is assigned only once in MIR, but cannot be propagated to `y`
    y
}
```

So any assignment to an argument cannot be propagated.
2017-12-03 17:43:48 -05:00
Corey Farwell
7c4f74d16e Rollup merge of #46454 - GuillaumeGomez:search-overlap, r=QuietMisdreavus
Fix search results overlap

Fixes #46434.

r? @QuietMisdreavus
2017-12-03 17:43:47 -05:00
Corey Farwell
697c5ba0d9 Rollup merge of #46442 - est31:master, r=alexcrichton
Remove an unstable and dead compiler flag

The last use has been removed by commit fb9ca16b3b .
2017-12-03 17:43:46 -05:00