314 Commits

Author SHA1 Message Date
varkor
ff59620734 Rename hair::PatternKind to hair::PatKind 2019-09-26 18:42:24 +01:00
varkor
7bc94cc3c2 Rename Item.node to Item.kind 2019-09-26 18:21:48 +01:00
varkor
d4573c9c1e Rename TraitItem.node to TraitItem.kind 2019-09-26 18:21:09 +01:00
varkor
ce6aabbaa1 Rename ImplItem.node to ImplItem.kind 2019-09-26 18:21:09 +01:00
varkor
8bd0382134 Rename Pat.node to Pat.kind 2019-09-26 18:21:09 +01:00
varkor
95f6d72a60 Rename Expr.node to Expr.kind
For both `ast::Expr` and `hir::Expr`.
2019-09-26 18:21:09 +01:00
varkor
e2e0f9af85 Rename sty to kind 2019-09-25 15:50:04 +01:00
Santiago Pastorino
e9c41148c0
Convert Place's projection to a boxed slice 2019-09-09 18:16:49 -03:00
Kevin Per
e0ce9f8c0a Cleanup: Consistently use Param instead of Arg 2019-08-27 14:07:41 +02:00
bors
555d7a2fd6 Auto merge of - wesleywiser:move_promoted_out, r=oli-obk
Move promoted MIR out of `mir::Body`

r? @oli-obk
2019-08-26 07:48:24 +00:00
Mark Rousskov
39412ca969 Permit unwinding through FFI by default
See  for context.
2019-08-25 09:47:50 -07:00
Wesley Wiser
73814654b2 Move promoted out of mir::Body 2019-08-22 06:36:30 -04:00
Caio
53fc7fbc96 Lint attributes on function arguments 2019-07-27 07:16:21 -03:00
Mazdak Farrokhzad
2e86c006f7
Rollup merge of - ljedrz:the_culmination_of_hiridification, r=Zoxc
The (almost) culmination of HirIdification

It's finally over.

This PR removes old `FIXME`s and renames some functions so that the `HirId` variant has the shorter name.
All that remains (and rightfully so) is stuff in `resolve`, `save_analysis` and (as far as I can tell) in a few places where we can't replace `NodeId` with `HirId`.
2019-07-05 20:26:56 +02:00
Mazdak Farrokhzad
18081890ea
Rollup merge of - rust-lang:fix-loop-break-mir-generation, r=eddyb
Break out of the correct number of scopes in loops

We were incorrectly breaking out of one too many drop scopes when
generating MIR for loops and breakable blocks, resulting in use after
free and associated borrow checker warnings.

This wasn't noticed because the scope that we're breaking out of twice
is only used for temporaries that are created for adjustments applied to
the loop. Since loops generally propagate coercions to the `break`
expressions, the only case we see this is when the type of the loop is a
smart pointer to a trait object.

Closes 
2019-07-05 13:53:13 +02:00
Matthew Jasper
1b7ffe5300 Break out of the correct number of scopes in loops
We were incorrectly breaking out of one too many drop scopes when
generating MIR for loops and breakable blocks, resulting in use after
free and associated borrow checker warnings.

This wasn't noticed because the scope that we're breaking out of twice
is only used for temporaries that are created for adjustments applied to
the loop. Since loops generally propagate coercions to the `break`
expressions, the only case we see this is when the type of the loop is a
smart pointer to a trait object.
2019-07-04 21:53:46 +01:00
ljedrz
37d7e1f22a rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-04 12:53:12 +02:00
Jeremy Stucki
6ae80cf23f
Remove needless lifetimes 2019-07-03 10:01:01 +02:00
Matthew Jasper
3131427784 Use Locals instead of Places in MIR drop generation 2019-06-25 22:41:22 +01:00
Matthew Jasper
be23bd47b7 Unify return, break and continue handling 2019-06-25 22:41:22 +01:00
Mazdak Farrokhzad
d406d89b31
Rollup merge of - spastorino:impl-place-from, r=oli-obk,Centril
Implement From<Local> for Place and PlaceBase

r? @oli-obk
More tiny bits of Place 2.0 moved into master
2019-06-25 17:15:37 +02:00
Santiago Pastorino
099f9e4e8a Implement From<Local> for Place and PlaceBase 2019-06-25 15:46:23 +02:00
ljedrz
f05cbc98f8 HIR: rename find_by_hir_id to find 2019-06-24 09:58:49 +02:00
ljedrz
90de9edce5 HIR: remove the NodeId find 2019-06-24 09:55:11 +02:00
ljedrz
73cb9ab526 rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
Mazdak Farrokhzad
fde341a4ef
Rollup merge of - cramertj:no-more-yield-errors, r=centril
Preserve generator and yield source for error messages

Previously, error messages after HIR lowering all referred
to generators and yield, regardless of whether the original
source was a generator or an async/await body. This change
tracks the kind of each generator and yield source in order
to provide appropriately tailored error messages.

Fixes .
2019-06-19 01:52:13 +02:00
Taylor Cramer
d67db0042c Preserve generator and yield source for error messages
Previously, error messages after HIR lowering all referred
to generators and yield, regardless of whether the original
source was a generator or an async/await body. This change
tracks the kind of each generator and yield source in order
to provide appropriately tailored error messages.
2019-06-18 16:22:22 -07:00
Eduard-Mihai Burtescu
b25b466a88 rustc: remove 'x: 'y bounds (except from comments/strings). 2019-06-18 18:10:21 +03:00
ljedrz
d996c4d5a3 remove _by_hir_id if there is no NodeId counterpart 2019-06-17 18:57:21 +02:00
ljedrz
61964d9732 replace some uses of NodeId with HirId 2019-06-17 18:57:20 +02:00
bors
68655029d4 Auto merge of - matthewjasper:optimize-false-edges, r=pnkfelix
Optimize matches

Attempt to fix or improve 

This is breaking some diagnostics because the MIR for match arms isn't in source order any more.

cc @centril
2019-06-16 09:30:34 +00:00
Eduard-Mihai Burtescu
f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
Matthew Jasper
da22793a35 Create fewer basic blocks in match MIR lowering 2019-06-13 21:05:21 +01:00
John Kåre Alsaker
d3e1181b1c Use a single lifetime for MIR construction 2019-06-12 19:27:00 +02:00
Eduard-Mihai Burtescu
fff08cb043 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-12 13:38:28 +03:00
Eduard-Mihai Burtescu
17cdd356da rustc: replace TyCtxt<'tcx, 'gcx, 'tcx> with TyCtxt<'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
2441253508 Fix fallout from deny(unused_lifetimes). 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
37799a5552 rustc: replace TyCtxt<'a, 'gcx, 'tcx> with TyCtxt<'tcx, 'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Jad Ghalayini
80ff07f30d Changed usages of mir in librustc::mir and librustc_mir to body 2019-06-09 16:05:05 -04:00
Matthew Jasper
6c9a018b60 Don't run MIR passes on constructor shims 2019-06-06 16:10:37 +01:00
bors
daf1ed0e98 Auto merge of - tmandry:emit-storagedead-along-unwind, r=eddyb
Emit StorageDead along unwind paths for generators

Completion of the work done in . That PR made a change to implicitly consider a local `StorageDead` after Drop, but that was incorrect for DropAndReplace (see also  which tried to fix this in a different way).

This finally enables the optimization implemented in .

r? @eddyb
cc @Zoxc @cramertj @RalfJung
2019-06-06 06:36:12 +00:00
Alexander Regueiro
35585c499f Aggregation of drive-by cosmetic changes. 2019-06-05 21:09:26 +01:00
Tyler Mandry
e8d639e42f Move cached_block out of DropKind 2019-06-04 16:14:36 -07:00
David Wood
5e3b41e0cb
rustc: remove HirId from ArgSource::AsyncFn
This commit removes the `HirId` from `ArgSource::AsyncFn`, relying on
the fact that only `simple_ident` is used in each of the locations that
previously took the original pattern from the `ArgSource::AsyncFn`.
2019-06-03 14:02:21 +01:00
David Wood
1e5f496143
rustc: async fn drop order lowering in HIR
This commit re-implements the async fn drop order lowering changes so
that it all takes place in HIR lowering, building atop the work done by
`@eddyb` to refactor `Res::Upvar`.

Previously, this types involved in the lowering were constructed in
libsyntax as they had to be used during name resolution and HIR
lowering. This was awful because none of that logic should have existed
in libsyntax.

This commit also changes `ArgSource` to keep a `HirId` to the original
argument pattern rather than a cloned copy of the pattern.
2019-06-03 10:20:35 +01:00
Eduard-Mihai Burtescu
961fe5479f rustc: use indexmap instead of a plain vector for upvars. 2019-06-01 19:17:22 +03:00
Eduard-Mihai Burtescu
3e5beb2c6f rustc: rename Mir to mir::Body in comments and to MIR in error strings. 2019-05-29 00:26:56 +03:00
Claude-Alban RANÉLY-VERGÉ-DÉPRÉ
6e5e0daff2 Changes the type mir::Mir into mir::Body
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.

Revisions asked by eddyb :
- Renamed of all the occurences of {visit/super}_mir
- Renamed test structures `CachedMir` to `Cached`

Fixing the missing import on `AggregateKind`
2019-05-28 19:17:51 +02:00
bors
85334c5092 Auto merge of - matthewjasper:add-match-arm-scopes, r=pnkfelix
Add match arm scopes and other scope fixes

* Add drop and lint scopes for match arms.
* Lint attributes are now respected on match arms.
* Make sure we emit a StorageDead if we diverge when initializing a temporary.
* Adjust MIR pretty printing of scopes for locals.
* Don't generate duplicate lint scopes for `let statements`.
* Add some previously missing fake borrows for matches.

closes 

cc @rust-lang/compiler
2019-05-23 04:48:21 +00:00
Vadim Petrochenkov
59a382122f Simplify use of keyword symbols 2019-05-22 19:48:56 +03:00