Commit Graph

42 Commits

Author SHA1 Message Date
Irina Popa b63d7e2b1c Rename trans to codegen everywhere. 2018-05-17 15:08:30 +03:00
John Kåre Alsaker 710b4ad2a5 Store the GeneratorInterior in the new GeneratorSubsts 2018-05-08 16:21:58 +02:00
Irina Popa 04fa0e7bb3 rustc_target: move in syntax::abi and flip dependency. 2018-04-26 17:49:16 +03:00
Tyler Mandry 98546f8b26 Make Binder's field private and clean up its usage 2018-04-24 22:12:07 -05:00
Niko Matsakis 6288faa3a3 `trans_apply_param_substs` => `subst_and_normalize_erasing_regions`
Consolidate `trans_apply_param_substs` and
`trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`
2018-03-13 11:22:08 -04:00
Niko Matsakis e4728e494e transition various normalization functions to the new methods
In particular:

- `fully_normalize_monormophic_ty` => `normalize_erasing_regions`
- `normalize_associated_type_in_env` => `normalize_erasing_regions`
- `fully_normalize_associated_types_in` => `normalize_erasing_regions`
- `erase_late_bound_regions_and_normalize` => `normalize_erasing_late_bound_regions`
2018-03-13 11:22:07 -04:00
Niko Matsakis 6d0f9319df refactor `ParamEnv::empty(Reveal)` into two distinct methods
- `ParamEnv::empty()` -- does not reveal all, good for typeck
- `ParamEnv::reveal_all()` -- does, good for trans
- `param_env.with_reveal_all()` -- converts an existing parameter environment
2018-03-13 11:21:30 -04:00
Oliver Schneider 38b5ddd39b
Add a variant to ConstVal for storing miri results 2018-03-08 08:06:07 +01:00
Wesley Wiser 4f840a683a Add `inline` to `TransFnAttrs`
Part of #47320
2018-03-06 19:58:02 -05:00
varkor 8b2037c6fe Introduce UnpackedKind
This adds an `UnpackedKind` type as a typesafe counterpart to `Kind`. This should make future changes to kinds (such as const generics!) more resilient, as the type-checker should catch more potential issues.
2018-02-23 01:13:54 +00:00
Malo Jaffré cbb32a9418 Fix docs for future pulldown migration 2018-01-01 14:44:12 +01:00
Ariel Ben-Yehuda f6fcfa3915 normalize the results of `tcx.type_of` after substituting
Also remove `def_ty`, which was a footgun because it did not do the
above.
2017-12-18 17:08:50 +02:00
Maik Klein ab0f8fcdac Test with trans_apply_param_substs 2017-12-18 17:08:49 +02:00
Maik Klein dfbb6e8640 Move instance related methods from TyCtxt to Instance 2017-12-18 17:08:49 +02:00
Maik Klein 531c27d805 Move common.rs functionality into TyCtxt 2017-12-18 17:08:48 +02:00
Oliver Schneider 7e5583b7f8
Merge remote-tracking branch 'origin/master' into miri 2017-12-11 10:01:29 +01:00
Niko Matsakis b4d71ea6f8 make `fn_sig().subst()` ICE when used with a closure
It's inefficient, and the substitution there doesn't account for the
extra regions used by NLL inference, so it's a bad thing to encourage.

As it happens all callers already know if they have a closure or not,
from what I can tell.
2017-12-07 05:28:01 -05:00
Oliver Schneider acdf83f228
Update miri to rustc changes 2017-12-06 09:25:29 +01:00
Niko Matsakis 2dff9a49e5 stop using the `closure_kinds` query / table for anything
Closure Kind is now extracted from the closure substs exclusively.
2017-11-18 07:47:37 -05:00
sinkuu afb52e1ca1 Fix MIR inlining panic in generic function 2017-11-05 22:57:53 +09:00
leonardo.yvens 06506bb751 [Syntax Breaking] Rename DefaultImpl to AutoImpl
DefaultImpl is a highly confusing name for what we now call auto impls,
as in `impl Send for ..`. The name auto impl is not formally decided
but for sanity anything is better than `DefaultImpl` which refers
neither to `default impl` nor to `impl Default`.
2017-11-03 16:13:20 -02:00
Oliver Schneider 490742e339
Resolve types properly in const eval 2017-10-25 10:17:20 +02:00
Wesley Wiser 31f4b57002 Turn `trans_fulfill_obligation` into a query
Part of #44891
2017-10-08 11:59:02 -04:00
Douglas Campos a29c770c68 make match exaustive 2017-09-29 22:34:51 -04:00
Douglas Campos 59e778e5e1 improve documentation for resolve() 2017-09-29 22:34:49 -04:00
Douglas Campos 29220663c1 style fixes as requested by @eddyb 2017-09-29 22:34:48 -04:00
Douglas Campos 081b29c1f6 stop using monomorphize::resolve() 2017-09-29 22:34:48 -04:00
Douglas Campos 8a5800e1d4 take ParamEnv into account when resolving 2017-09-29 22:34:47 -04:00
Douglas Campos 24fc50fffa make it not to be a method 2017-09-29 22:34:46 -04:00
Douglas Campos baa010561e copy resolve() over to librustc 2017-09-29 22:34:45 -04:00
scalexm f7964aebe5 Implement `Copy`/`Clone` for closures 2017-09-20 20:43:41 +02:00
Douglas Campos d3bbce79d0 bring TyCtxt into scope 2017-09-13 23:00:17 -04:00
scalexm 4e4e55aa77 Rename `BuiltinShim` -> `CloneShim` 2017-08-14 15:07:21 +02:00
scalexm 0c3ac648f8 Make `Clone` a lang item and generate builtin impls.
Fixes #28229.
Fixes #24000.
2017-08-14 15:07:21 +02:00
Michael Woerister e00bec2dd4 Allow 'tcx in define_dep_nodes! and deduplicate some DepNodes. 2017-07-10 12:20:56 +02:00
Michael Woerister 3607174909 incr.comp.: Uniformly represent DepNodes as (Kind, StableHash) pairs. 2017-06-09 15:03:34 +02:00
Eduard-Mihai Burtescu 612bb1f54e rustc: rename some of the queries to match tcx methods. 2017-04-24 15:20:52 +03:00
Ariel Ben-Yehuda ece6c8434b cache attributes of items from foreign crates
this avoids parsing item attributes on each call to `item_attrs`, which takes
off 33% (!) of translation time and 50% (!) of trans-item collection time.
2017-04-22 21:00:50 +03:00
Ariel Ben-Yehuda f2c7917402 translate drop glue using MIR
Drop of arrays is now translated in trans::block in an ugly way that I
should clean up in a later PR, and does not handle panics in the middle
of an array drop, but this commit & PR are growing too big.
2017-03-18 02:53:08 +02:00
Ariel Ben-Yehuda e1f3c67cb4 translate closure shims using MIR 2017-03-18 02:53:07 +02:00
Ariel Ben-Yehuda aac5ba5dab resolve instances to ty::Instance directly
This removes the duplication between collector, callee, and (eventually)
MIRI.
2017-03-18 02:53:07 +02:00
Ariel Ben-Yehuda ffee9566bb move Instance to rustc and use it in the collector 2017-03-18 02:53:04 +02:00