Commit Graph

171 Commits

Author SHA1 Message Date
Wesley Wiser
73814654b2 Move promoted out of mir::Body 2019-08-22 06:36:30 -04:00
bors
a807902dd6 Auto merge of #63463 - matthewjasper:ty_param_cleanup, r=petrochenkov
Don't special case the `Self` parameter by name

This results in a couple of small diagnostic regressions. They could be avoided by keeping the special case just for diagnostics, but that seems worse.

closes #50125
cc #60869
2019-08-19 01:31:35 +00:00
Matthew Jasper
24587d20df Pre intern the Self parameter type
Use this to simplify the object safety code a bit.
2019-08-18 19:25:12 +01:00
Eduard-Mihai Burtescu
b565ece5d8 Remove redundant ty fields from mir::Constant and hair::pattern::PatternRange. 2019-08-16 15:20:27 +03:00
Matthew Jasper
2f6babbc6d Remove is_self and has_self_ty methods 2019-08-11 15:00:42 +01:00
Ralf Jung
8e6fbbec83 add tuple_fields convenience method and use it in a few places 2019-08-11 12:04:49 +02:00
Oliver Scherer
7710820d18 Fiddle param env through to try_eval_bits in most places 2019-08-05 17:48:05 +02:00
Oliver Scherer
9b87d22ea8 Don't abort on unevaluated constants without at least tryting to eval them 2019-08-05 17:48:04 +02:00
Jeremy Stucki
ec711767a7
Remove needless lifetimes 2019-07-03 10:01:02 +02:00
Santiago Pastorino
099f9e4e8a Implement From<Local> for Place and PlaceBase 2019-06-25 15:46:23 +02:00
Eduard-Mihai Burtescu
b25b466a88 rustc: remove 'x: 'y bounds (except from comments/strings). 2019-06-18 18:10:21 +03:00
Eduard-Mihai Burtescu
afc39bbf24 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-14 18:58:32 +03:00
Eduard-Mihai Burtescu
f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03: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
John Kåre Alsaker
6d387463aa Remove GlobalArenas and use Arena instead 2019-05-31 09:44:37 +02: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
Andrew Xu
46b9ed4fa1 Rename "Associated*" to "Assoc*"
We are going to uniform the terminology of all associated items.
Methods that may or may not have `self` are called "associated
functions". Because `AssociatedFn` is a bit long, we rename `Associated`
to `Assoc`.
2019-05-26 17:49:02 +08:00
Oliver Scherer
e694b63cd1 Don't use ty::Const without immediately interning 2019-05-25 10:07:01 +02:00
Nicholas Nethercote
b557567c35 Remove impls for InternedString/string equality.
`Symbol` received the same treatment in #60630.

Also, we can derive `PartialEq` for `InternedString`.
2019-05-21 20:08:33 +10:00
bors
47e0803d5c Auto merge of #60195 - varkor:commontypes-to-common, r=eddyb
Split `CommonTypes` into `CommonTypes` and `CommonLifetimes`

The so-called "`CommonTypes`" contains more than just types.

r? @eddyb
2019-05-01 09:32:58 +00:00
flip1995
e1da67e69c
Fix lint findings in librustc_mir 2019-04-28 21:19:27 +02:00
varkor
a3470c6189 Update handling of Tuple 2019-04-26 21:09:32 +01:00
varkor
7261bd88ac Update existing usages 2019-04-25 22:05:04 +01:00
David Wood
5c3d1e5d76 Separate variant id and variant constructor id.
This commit makes two changes - separating the `NodeId` that identifies
an enum variant from the `NodeId` that identifies the variant's
constructor; and no longer creating a `NodeId` for `Struct`-style enum
variants and structs.

Separation of the variant id and variant constructor id will allow the
rest of RFC 2008 to be implemented by lowering the visibility of the
variant's constructor without lowering the visbility of the variant
itself.

No longer creating a `NodeId` for `Struct`-style enum variants and
structs mostly simplifies logic as previously this `NodeId` wasn't used.
There were various cases where the `NodeId` wouldn't be used unless
there was an unit or tuple struct or enum variant but not all uses of
this `NodeId` had that condition, by removing this `NodeId`, this must
be explicitly dealt with. This change mostly applied cleanly, but there
were one or two cases in name resolution and one case in type check
where the existing logic required a id for `Struct`-style enum variants
and structs.
2019-03-24 12:10:16 +03:00
Oliver Scherer
5cd2806621 Revert the LazyConst PR 2019-03-16 21:04:10 +01:00
varkor
8e56729b4d Handle new ConstValue variants in mir
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05 22:19:26 +00:00
ljedrz
fb22315f08 hir: remove NodeId from VariantData 2019-03-02 07:48:52 +01:00
Santiago Pastorino
0f993d5a7a Put Local, Static and Promoted as one Base variant of Place 2019-03-01 05:02:00 +01:00
csmoe
cf11729787 rename Substs to InternalSubsts
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-27 00:39:13 +08:00
Alexander Regueiro
c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
bors
de111e6367 Auto merge of #58103 - RalfJung:mir-shim-dump, r=eddyb
Make -Zdump-mir dump shims

Fixes https://github.com/rust-lang/rust/issues/53532 by (a) making the MIR shim generation use the MIR pass infrastructure, and (b) fixing said infrastructure to handle the fallout.

Cc @eddyb @oli-obk
2019-02-10 08:52:10 +00:00
bors
d329d46a3f Auto merge of #58207 - nnethercote:intern_lazy_const, r=oli-obk
Make `intern_lazy_const` actually intern its argument.

Currently it just unconditionally allocates it in the arena.

For a "Clean Check" build of the the `packed-simd` benchmark, this
change reduces both the `max-rss` and `faults` counts by 59%; it
slightly (~3%) increases the instruction counts but the `wall-time` is
unchanged.

For the same builds of a few other benchmarks, `max-rss` and `faults`
drop by 1--5%, but instruction counts and `wall-time` changes are in the
noise.

Fixes #57432, fixes #57829.
2019-02-09 12:38:51 +00:00
Ralf Jung
2708946787 pass full InstanceDef to run_passes 2019-02-09 12:11:12 +01:00
Ralf Jung
f5bbcf3818 use pass infrastructure for mir shims, so that they can get dumped 2019-02-09 12:08:39 +01:00
Taiki Endo
725af30809 librustc_mir => 2018 2019-02-08 06:28:15 +09:00
Nicholas Nethercote
f2871a9ce5 Make intern_lazy_const actually intern its argument.
Currently it just unconditionally allocates it in the arena.

For a "Clean Check" build of the the `packed-simd` benchmark, this
change reduces both the `max-rss` and `faults` counts by 59%; it
slightly (~3%) increases the instruction counts but the `wall-time` is
unchanged.

For the same builds of a few other benchmarks, `max-rss` and `faults`
drop by 1--5%, but instruction counts and `wall-time` changes are in the
noise.

Fixes #57432, fixes #57829.
2019-02-06 12:50:28 +11:00
bors
d6d32ac25d Auto merge of #56723 - oli-obk:lazy_const, r=nikomatsakis
Don't emit `Unevaluated` from `const_eval`

cc @eddyb @RalfJung
2019-01-04 17:01:24 +00:00
Niko Matsakis
8e89184a7b rename type_moves_by_default to type_is_copy_modulo_regions 2019-01-02 17:35:06 -05:00
Oliver Scherer
37a0df3e9d <&'tcx ty::Const as Deref>::deref 2019-01-01 20:05:02 +01:00
Oliver Scherer
f36c6559ea Add unwrap_usize to LazyConst, too 2019-01-01 20:05:02 +01:00
Oliver Scherer
b903cb9d60 Move the Unevaluated constant arm upwards in the type structure 2019-01-01 20:05:02 +01:00
David Wood
24a7a010d1
Refactor UserTypeAnnotation.
This commit refactors the `UserTypeAnnotation` type to be referred to by
an index within `UserTypeProjection`. `UserTypeAnnotation` is instead
kept in an `IndexVec` within the `Mir` struct.

Further, instead of `UserTypeAnnotation` containing canonicalized types,
it now contains normal types and the entire `UserTypeAnnotation` is
canonicalized. To support this, the type was moved from the `rustc::mir`
module to `rustc::ty` module.
2018-12-30 14:25:20 +01:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
bors
4755e2f3b6 Auto merge of #56741 - RalfJung:retag-to-raw, r=oli-obk
treat ref-to-raw cast like a reborrow: do a special kind of retag

r? @oli-obk

Cc @nikomatsakis
2018-12-20 09:58:10 +00:00
bors
cb84844e83 Auto merge of #56160 - oli-obk:const_fn_let, r=nikomatsakis
Fix various aspects around `let` bindings inside const functions

* forbid `let` bindings in const contexts that use short circuiting operators
* harden analysis code against derefs of mutable references

Initially this PR was about stabilizing `let` bindings, but too many flaws were exposed that need some more testing on nightly
2018-12-18 14:21:07 +00:00