Commit Graph

156 Commits

Author SHA1 Message Date
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 9fe0052e54 rustc: remove the closure ID from hir::Upvar's parent field. 2019-06-01 19:01:09 +03:00
Eduard-Mihai Burtescu 4b9670a245 rustc: remove the index field from Res::Upvar. 2019-06-01 19:01:09 +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
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 fb084a48e2 Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions. 2019-05-13 09:29:22 +10:00
John Kåre Alsaker b8b4ad597a Update region_scope_tree 2019-04-25 18:23:32 +02:00
Oliver Scherer 5cd2806621 Revert the `LazyConst` PR 2019-03-16 21:04:10 +01:00
John Kåre Alsaker 1879d17f08 Only insert nodes which changes lint levels in the LintLevelMap 2019-03-05 19:37:19 +01:00
ljedrz 50b8bc8c8c hir: remove NodeId from Pat and FieldPat 2019-03-02 07:48:52 +01:00
csmoe cf11729787 rename Substs to InternalSubsts
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-27 00:39:13 +08:00
ljedrz d7ced1dd5a hir: remove NodeId from Expr 2019-02-24 17:09:37 +01:00
ljedrz 021a140dcd hir: remove NodeId from Block 2019-02-24 17:09:26 +01:00
Alexander Regueiro c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +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
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
Oliver Scherer 64afc6b517 Differentiate between closure and function bodies 2019-01-21 10:12:17 +01: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 b903cb9d60 Move the `Unevaluated` constant arm upwards in the type structure 2019-01-01 20:05:02 +01:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07: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
John Kåre Alsaker a70babed03 Use a function to access the Hir map to be able to turn it into a query later 2018-12-06 17:24:36 +01:00
Oliver Scherer 16d2a92b3d Improve the diagnostic message 2018-11-30 09:44:15 +01:00
Oliver Scherer 507ea97a3e Properly name the flag for `&&` -> `&` conversion 2018-11-30 09:44:06 +01:00
Oliver Scherer d62bcad38d Allow `let` bindings everywhere 2018-11-30 09:44:06 +01:00
Oliver Scherer afb8cba5fc Move hir::Lit -> ty::Const conversion into its own file 2018-11-28 17:15:40 +01:00
Oliver Scherer 40412dc09a Deduplicate literal -> constant lowering 2018-11-28 16:07:30 +01:00
Oliver Scherer 4a9ed3f25a Use type safe `VariantIdx` instead of `usize` everywhere 2018-11-12 14:24:45 +01:00
Eduard-Mihai Burtescu d00d42d079 rustc_target: pass contexts by reference, not value. 2018-11-04 20:33:57 +02:00
Niko Matsakis f4b711516d move `user_annotated_ty_for_adt` into a helper trait 2018-10-08 19:20:37 -04:00
kenta7777 5c3ba4aa4f renamed mk_nil to mk_unit 2018-09-10 11:07:13 +09:00
Oliver Schneider 472ca71598 Implement the `min_const_fn` feature gate 2018-08-31 08:39:59 +02:00
varkor e2a1cce9c5 Rename hir::map::NodeKind to hir::Node 2018-08-27 21:46:23 +01:00
varkor 11665ca45a Remove path prefixes from NodeKind 2018-08-27 21:46:13 +01:00
varkor befc4b1100 Rename hir::map::Node to hir::map::NodeKind 2018-08-27 21:45:46 +01:00
varkor 8a5dccde2a Remove Ty prefix from Ty{Bool|Char|Int|Uint|Float|Str} 2018-08-22 16:08:49 +01:00
Ralf Jung ad2de8b4ee miri/CTFE refactor
* Value gets renamed to Operand, so that now interpret::{Place, Operand} are the
  "dynamic" versions of mir::{Place, Operand}.
* Operand and Place share the data for their "stuff is in memory"-base in a new
  type, MemPlace.  This also makes it possible to give some more precise types
  in other areas.  Both Operand and MemPlace have methods available to project
  into fields (and other kinds of projections) without causing further
  allocations.
* The type for "a Scalar or a ScalarPair" is called Value, and again used to
  give some more precise types.
* All of these have versions with an attached layout, so that we can more often
  drag the layout along instead of recomputing it.  This lets us get rid of
  `PlaceExtra::Downcast`.  MPlaceTy and PlaceTy can only be constructed
  in place.rs, making sure the layout is handled properly.
  (The same should eventually be done for ValTy and OpTy.)
* All the high-level functions to write typed memory take a Place, and live in
  place.rs.  All the high-level typed functions to read typed memory take an
  Operand, and live in operands.rs.
2018-08-22 09:06:28 +02:00
Oliver Schneider c6c06854c0 Reintroduce `Undef` and properly check constant value sizes 2018-08-01 15:29:35 +02:00
Oliver Schneider de511438cd Promoteds are statics and statics have a place, not just a value 2018-07-23 09:51:30 +02:00
Vadim Petrochenkov f0622dfe5d Use `Ident`s for associated item definitions in HIR
Remove emulation of hygiene with gensyms
2018-06-28 11:04:50 +03:00
Oliver Schneider 85de4efdd8 Rename `amt` variables to `shift` 2018-05-24 20:49:38 +02:00
Oliver Schneider 80a1488601 Prefer `to_value_with_len` over manual expanison of it 2018-05-24 20:49:38 +02:00
Oliver Schneider bdd23bf215 `tcx.lift_to_global` > `tcx.global_tcx().lift` 2018-05-24 20:49:38 +02:00
Oliver Schneider 569ae80a0a Wrongly named a closure `clamp` when it was doing truncation 2018-05-24 20:49:38 +02:00
Oliver Schneider cc60a22b10 Get rid of `scalar_size` 2018-05-24 20:49:37 +02:00
Oliver Schneider 64a75ecc80 change `Value::Bytes` to `Value::Bits` 2018-05-24 20:49:37 +02:00