Matthew Jasper
f71f733d48
Add a MIR transform to remove fake reads
...
As we are now creating borrows of places that may not be valid for
borrow checking matches, these have to be removed to avoid generating
broken code.
2018-09-24 23:33:13 +01:00
Rémy Rakic
e90c942477
Update mir-opt test suite
2018-09-18 14:36:37 +02:00
bors
dfabe4b885
Auto merge of #54032 - oli-obk:layout_scalar_ranges, r=eddyb
...
Add forever unstable attribute to allow specifying arbitrary scalar ranges
r? @eddyb for the first commit and @nikomatsakis for the second one
2018-09-14 09:47:21 +00:00
Oliver Schneider
5f42a0f005
Change debug printing to print in the old concise style
2018-09-11 13:49:10 +02:00
Niko Matsakis
2f6628ecec
optimize let x: T = .. to avoid a temporary
...
For some weird reason this fixes `intrinsic-move-val`. It also affects
various test heuristics. I removed one test (`reborrow_basic`) that
didn't seem to really be testing anything in particular anymore,
compared to all the other tests we've got.
2018-09-10 08:28:56 -04:00
Niko Matsakis
dd3cc9669a
add the AscribeUserType statement kind
...
Make it have the semantics of subtype.
2018-09-10 08:22:31 -04:00
bors
0198a1ea45
Auto merge of #53909 - mikhail-m1:53643, r=nikomatsakis
...
Skip a shared borrow of a immutable local variables
issue #53643
r? @nikomatsakis
2018-09-08 19:57:14 +00:00
Wesley Wiser
b1211e8703
Fix tests
2018-09-06 22:57:05 -04:00
Mikhail Modin
527a29a5c6
Skip a shared borrow of a immutable local variables
...
issue #53643
2018-09-06 21:46:52 +01:00
Oliver Schneider
d125e904b5
Restrict most uses of const_fn to min_const_fn
2018-08-31 08:40:00 +02:00
Oliver Schneider
472ca71598
Implement the min_const_fn feature gate
2018-08-31 08:39:59 +02:00
Niko Matsakis
7eec37b2f9
merge PointIndexMap and RegionValueElements
2018-08-27 13:57:55 -04:00
Niko Matsakis
fe34c90458
patch up mir-opt tests
2018-07-26 15:12:04 +03:00
Oliver Schneider
cbd42749ef
Update mir-opt to promoted changes
2018-07-23 09:51:31 +02:00
dylan_DPC
0770ff0500
delete tests
2018-07-21 19:46:41 +05:30
dylan_DPC
7db3324340
remove unwanted tests and a reference to it in comments
2018-07-21 11:42:44 +05:30
bors
e92e9ce0d8
Auto merge of #52046 - cramertj:fix-generator-mir, r=eddyb
...
Ensure StorageDead is created even if variable initialization fails
Rebase and slight cleanup of https://github.com/rust-lang/rust/pull/51109
Fixes https://github.com/rust-lang/rust/issues/49232
r? @eddyb
2018-07-13 00:38:17 +00:00
Taylor Cramer
9c15a6606e
Ensure StorageDead is created even if variable initialization fails
2018-07-12 10:13:41 -07:00
gnzlbg
4ff90c7e0a
bump minimum LLVM version to 5.0
2018-07-09 11:35:52 +02:00
bors
b51ca20ce5
Auto merge of #51964 - matthewjasper:unused-mut-mir-generation, r=nikomatsakis
...
[NLL] Fix various unused mut errors
Closes #51801
Closes #50897
Closes #51830
Closes #51904
cc #51918 - keeping this one open in case there are any more issues
This PR contains multiple changes. List of changes with examples of what they fix:
* Change mir generation so that the parameter variable doesn't get a name when a `ref` pattern is used as an argument
```rust
fn f(ref y: i32) {} // doesn't trigger lint
```
* Change mir generation so that by-move closure captures don't get first moved into a temporary.
```rust
let mut x = 0; // doesn't trigger lint
move || {
x = 1;
};
```
* Treat generator upvars the same as closure upvars
```rust
let mut x = 0; // This mut is now necessary and is not linted against.
move || {
x = 1;
yield;
};
```
r? @nikomatsakis
2018-07-05 00:22:14 +00:00
Matthew Jasper
125c9d99e5
Fix various nll unused mut errors
2018-07-03 20:12:09 +01:00
Niko Matsakis
73f8333e78
update mir-opt tests
2018-07-01 10:13:05 -04:00
Matthew Jasper
43fce075d3
Update MIR opt tests
2018-06-27 22:06:21 +01:00
varkor
ee7e30f14a
Fix codegen tests
2018-06-23 18:00:47 +01:00
Eduard-Mihai Burtescu
3da186b67f
rustc: use syntactic (instead of visibility) source info where appropriate.
2018-05-30 20:30:10 +03:00
Felix S. Klock II
5eebd36c93
Test update: Fallout from ReadForMatch statements + changes to codegen under NLL.
2018-05-29 23:02:40 +02:00
John Kåre Alsaker
6c2d875261
Make &Slice a thin pointer
2018-05-27 17:28:35 +02:00
bors
c6a1979e20
Auto merge of #50603 - eddyb:issue-49955, r=nikomatsakis
...
rustc_mir: allow promotion of promotable temps indexed at runtime.
Fixes #49955 .
r? @nikomatsakis
2018-05-19 00:27:45 +00:00
Eduard-Mihai Burtescu
d1f117df0f
rustc_mir: allow promotion of promotable temps indexed at runtime.
2018-05-16 15:40:54 +03:00
Eduard-Mihai Burtescu
b9af400a46
rustc_mir: generate an extra temporary during borrowed rvalue promotion.
2018-05-16 14:11:01 +03:00
Niko Matsakis
a64ef13a06
"fix" test region-liveness-two-disjoint-uses
...
We no longer get two disjoint uses. =)
2018-05-10 17:14:51 -04:00
Felix S. Klock II
930e76e2af
Update mir-opt test to reflect change to MIR code-generation.
2018-05-04 13:17:13 +02:00
Niko Matsakis
45d281d7fa
remove -Znll -- borrowck=mir implies nll now
2018-04-15 07:13:42 -04:00
Vadim Petrochenkov
fcf48520a0
Add some new tests + Fix failing tests
2018-04-12 23:06:03 +03:00
Vadim Petrochenkov
1a2a23447e
Stabilize attributes on generic parameters
2018-04-05 02:19:56 +03:00
Mark Mansi
7ce8191775
Stabilize i128_type
2018-03-26 08:36:50 -05:00
David Wood
03481f19ea
Updated MIR with UserAssertTy in mir-opt tests.
2018-03-23 11:34:06 +00:00
Niko Matsakis
94eebaa325
WIP fix mir-opt-end-region-8
2018-03-21 09:24:32 -04:00
Vadim Petrochenkov
7c90189e13
Stabilize slice patterns without ..
...
Merge `feature(advanced_slice_patterns)` into `feature(slice_patterns)`
2018-03-20 02:27:40 +03:00
Oliver Schneider
d98a2b90b2
Rebase fallout
2018-03-08 08:34:17 +01:00
Oliver Schneider
918b6d7633
Produce instead of pointers
2018-03-08 08:08:14 +01:00
Manish Goregaokar
f59ab8e96a
Rollup merge of #48355 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis
...
Fixes #47311 .
r? @nrc
2018-02-28 15:09:22 -08:00
Mikhail Modin
12c7e27330
restore Subslice move out from array after elaborate drops and borrowck
2018-02-25 18:59:16 +03:00
Eduard-Mihai Burtescu
c9fcedeb4c
rustc_mir: optimize the deaggregator's expansion of statements.
2018-02-20 02:50:26 +02:00
Eduard-Mihai Burtescu
d773d95880
rustc_mir: don't run the deaggregator on arrays for now.
2018-02-20 02:50:26 +02:00
Eduard-Mihai Burtescu
b88180f74c
rustc_mir: handle all aggregate kinds in the deaggregator.
2018-02-20 02:50:26 +02:00
Matthias Krüger
4452446292
fix more typos found by codespell.
2018-02-17 17:38:49 +01:00
bors
b85bd51c94
Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis
...
add transform for uniform array move out
reworked second step for fix #34708
previous try #46686
r? @nikomatsakis
2018-02-17 08:44:41 +00:00
bors
7f2baba121
Auto merge of #48092 - eddyb:discriminate-the-void, r=nikomatsakis
...
rustc_mir: insert a dummy access to places being matched on, when building MIR.
Fixes #47412 by adding a `_dummy = Discriminant(place)` before each `match place {...}`.
r? @nikomatsakis
2018-02-11 02:42:19 +00:00
Eduard-Mihai Burtescu
8af134e031
rustc_mir: insert a dummy access to places being matched on, when building MIR.
2018-02-09 23:25:10 +02:00