bors
b1d9f31e04
Auto merge of #78638 - vn-ki:bindigs-after-at-issue-69971, r=oli-obk
...
reverse binding order in matches to allow the subbinding of copyable fields in bindings after @
Fixes #69971
### TODO
- [x] Regression tests
r? `@oli-obk`
2020-11-05 13:26:08 +00:00
oli
abacaf2aef
u128
truncation and sign extension are not just interpreter related
2020-11-04 13:41:58 +00:00
Vishnunarayan K I
5827fbadf6
review comments
2020-11-03 17:14:51 +05:30
Vishnunarayan K I
f422e811e4
preserve bindings order for Some
2020-11-03 12:15:41 +05:30
Vishnunarayan K I
6bdce7bedd
new fix method and update tests
2020-11-02 22:29:20 +05:30
Vishnunarayan K I
c93d25b6af
reverse binding order in matches ...
...
... to allow the subbinding of copyable fields in bindings after `@`
Fixes #69971
2020-11-02 00:05:55 +05:30
Joshua Nelson
57c6ed0c07
Fix even more clippy warnings
2020-10-30 10:13:39 -04:00
Santiago Pastorino
708fc3b1a2
Add unsized_fn_params feature
2020-10-27 14:45:02 -03:00
Yuki Okushi
b72d70ef61
Rollup merge of #78377 - LeSeulArtichaut:patch-docs, r=jonas-schievink
...
Fix typo in debug statement
2020-10-27 08:45:14 +09:00
LeSeulArtichaut
9de15188b0
Fix typo in debug statement
2020-10-25 20:54:44 +01:00
Eduard-Mihai Burtescu
6451b39a25
rustc_mir: support MIR-inlining #[track_caller] functions.
2020-10-21 04:43:56 +03:00
Eduard-Mihai Burtescu
6bc5eafbce
rustc_mir: track inlined callees in SourceScopeData.
2020-10-21 04:43:56 +03:00
bors
6af9846fcc
Auto merge of #77124 - spastorino:const-exprs-rfc-2920, r=oli-obk
...
Implement const expressions and patterns (RFC 2920)
cc `@ecstatic-morse` `@lcnr` `@oli-obk` `@petrochenkov`
2020-10-17 14:44:51 +00:00
Tomasz Miąsko
a65a283332
Remove unused cached_unreachable_block from MIR builder
2020-10-17 00:00:00 +00:00
Santiago Pastorino
fe922e567f
Lower inline const down to MIR
2020-10-16 15:21:18 -03:00
Ding Xiang Fei
f9ccd39ae3
documentation fix
2020-10-14 00:50:54 +08:00
Jonas Schievink
432535da2b
Refactor how SwitchInt stores jump targets
2020-10-10 17:46:11 +02:00
bors
62bfcfd8a3
Auto merge of #77552 - ecstatic-morse:body-def-id, r=lcnr
...
Replace `(Body, DefId)` with `Body` where possible
Follow-up to #77430 .
I `grep`-ed for parameter lists in which a `Body` appeared within a few lines of a `DefId`, so it's possible that I missed some cases, but this should be pretty complete. Most of these changes were mechanical, but there's a few places where I started calling things "caller" and "callee" when multiple `DefId`s were in-scope at once. Also, we should probably have a helper function on `Body` that returns a `LocalDefId`. I can do that in this PR or in a follow-up.
2020-10-05 09:26:32 +00:00
bors
ced813fec0
Auto merge of #77466 - Aaron1011:reland-drop-tree, r=matthewjasper
...
Re-land PR #71840 (Rework MIR drop tree lowering)
PR https://github.com/rust-lang/rust/pull/71840 was reverted in https://github.com/rust-lang/rust/pull/72989 to fix an LLVM error (https://github.com/rust-lang/rust/issues/72470 ). That LLVM error no longer occurs with the recent upgrade to LLVM 11 (https://github.com/rust-lang/rust/pull/73526 ), so let's try re-landing this PR.
I've cherry-picked the commits from the original PR (with the exception of the commit blessing test output), making as few modifications as possible. I addressed the rebase fallout in separate commits on top of those.
r? `@matthewjasper`
2020-10-05 00:35:58 +00:00
Dylan MacKenzie
e72e43c730
Replace (Body, DefId)
with Body
where possible
...
A `Body` now contains its `MirSource`, which in turn contains the
`DefId` of the item associated with the `Body`.
2020-10-04 16:07:03 -07:00
Dylan MacKenzie
606655edc4
HACK: Overwrite the MIR's source with the correct const param
...
There's a cleaner way of doing this, but it involves passing
`WithOptConstParam` around in more places. We're going to try to explore
different approaches before committing to that.
2020-10-04 11:02:16 -07:00
Dylan MacKenzie
6f61e71648
Remember the MirSource
for each Body
2020-10-04 11:01:38 -07:00
Aaron Hill
eb94cdd85e
Apply suggestions from review
...
Co-authored-by: matthewjasper <20113453+matthewjasper@users.noreply.github.com>
2020-10-04 07:54:03 -04:00
Aaron Hill
8478385ea4
Fix broken link
2020-10-04 07:54:02 -04:00
Aaron Hill
4c83eec008
Fix rebase fallout
2020-10-04 07:54:02 -04:00
Matthew Jasper
8902ce5d84
Address review comments
2020-10-04 07:54:02 -04:00
Matthew Jasper
1e71862046
Add some more comments
2020-10-04 07:54:02 -04:00
Matthew Jasper
fa3e2fcbe4
Defer creating drop trees in MIR lowering until leaving that scope
2020-10-04 07:54:01 -04:00
yuk1ty
16047d46a1
fix typo in docs and comments
2020-09-21 12:14:28 +09:00
Ralf Jung
8405d50e12
Rollup merge of #76890 - matthiaskrgr:matches_simpl, r=lcnr
...
use matches!() macro for simple if let conditions
2020-09-20 15:52:01 +02:00
Matthias Krüger
40dddd3305
use matches!() macro for simple if let conditions
2020-09-18 20:28:35 +02:00
Matthias Krüger
f567287f9f
don't convert types to the same type with try_into (clippy::useless_conversion)
2020-09-15 22:49:50 +02:00
Aaron Hill
f422ef141a
Add CONST_ITEM_MUTATION lint
...
Fixes #74053
Fixes #55721
This PR adds a new lint `CONST_ITEM_MUTATION`.
Given an item `const FOO: SomeType = ..`, this lint fires on:
* Attempting to write directly to a field (`FOO.field = some_val`) or
array entry (`FOO.array_field[0] = val`)
* Taking a mutable reference to the `const` item (`&mut FOO`), including
through an autoderef `FOO.some_mut_self_method()`
The lint message explains that since each use of a constant creates a
new temporary, the original `const` item will not be modified.
2020-09-07 08:44:35 -04:00
LeSeulArtichaut
3e14b684dd
Change ty.kind to a method
2020-09-04 17:47:51 +02:00
mark
9e5f7d5631
mv compiler to compiler/
2020-08-30 18:45:07 +03:00