rust/src
bors c7ab8840c8 Auto merge of #33425 - eddyb:rift, r=nikomatsakis
Split the type context into a global and a local (inference-only) one.

After this change, each `InferCtxt` creates its own local type interner for types with inference by-products.
Most of the code which handles both a global and a local interner uses `'gcx` and `'tcx` for them.
A reference to the type context in that situation (e.g. `infcx.tcx`) is `TyCtxt<'a, 'gcx, 'tcx>`.
The global type context which used to be `&'a TyCtxt<'tcx>` is now `TyCtxt<'a, 'tcx, 'tcx>`.

In order to minimize the number of extra lifetime parameters, many functions became methods.
Where possible (some inherent impls), lifetime parameters were added on the impl, not each method.

As inference by-products no longer escape their inference contexts, memory usage is lower.
Example of `-Z time-passes` excerpt for `librustc`, stage1 (~100MB gains):
Before "rustc: Split local type contexts interners from the global one.":
```
time: 0.395; rss: 335MB item-types checking
time: 15.392; rss: 472MB        item-bodies checking
time: 0.000; rss: 472MB drop-impl checking
time: 1.140; rss: 478MB const checking
time: 0.139; rss: 478MB privacy checking
time: 0.024; rss: 478MB stability index
time: 0.072; rss: 478MB intrinsic checking
time: 0.038; rss: 478MB effect checking
time: 0.255; rss: 478MB match checking
time: 0.128; rss: 484MB liveness checking
time: 1.372; rss: 484MB rvalue checking
time: 1.404; rss: 597MB MIR dump
time: 0.809; rss: 599MB MIR passes
```
After:
```
time: 0.467; rss: 337MB item-types checking
time: 17.443; rss: 395MB        item-bodies checking
time: 0.000; rss: 395MB drop-impl checking
time: 1.423; rss: 401MB const checking
time: 0.141; rss: 401MB privacy checking
time: 0.024; rss: 401MB stability index
time: 0.116; rss: 401MB intrinsic checking
time: 0.038; rss: 401MB effect checking
time: 0.382; rss: 401MB match checking
time: 0.132; rss: 407MB liveness checking
time: 1.678; rss: 407MB rvalue checking
time: 1.614; rss: 503MB MIR dump
time: 0.957; rss: 512MB MIR passes
```

**NOTE**: Functions changed to methods weren't re-indented to keep this PR easier to review.
Once approved, the changes will be mechanically performed.
However, indentation changes of function arguments are there - and I believe there's a way to hide whitespace-only changes in diffs on GitHub.
2016-05-10 23:40:09 -07:00
..
bootstrap rustc: Implement custom panic runtimes 2016-05-09 08:22:36 -07:00
build_helper whoops 2016-04-04 21:14:15 +10:00
compiler-rt@57315f7e07
doc Auto merge of #33512 - birkenfeld:issue-25944, r=sanxiyn 2016-05-10 20:14:46 -07:00
driver
etc test: Move run-make tests into compiletest 2016-04-28 21:46:40 -07:00
grammar
jemalloc@aab1c0a0e0
liballoc Rollup merge of #32741 - tbu-:pr_remove_fixme_12808, r=bluss 2016-04-07 23:26:19 +05:30
liballoc_jemalloc Fix alloc_jemalloc on windows gnu targets 2016-05-01 13:16:06 +01:00
liballoc_system rustc: Implement custom panic runtimes 2016-05-09 08:22:36 -07:00
libarena
libbacktrace
libcollections Rollup merge of #33402 - shepmaster:copied-variable-name, r=Manishearth 2016-05-07 15:35:17 -04:00
libcollectionstest Utilize Result::unwrap_err in more places. 2016-05-09 08:40:57 -04:00
libcore Add new atomic integer types 2016-05-09 13:31:47 +01:00
libcoretest Rollup merge of #33426 - sfackler:try-from, r=aturon 2016-05-08 07:02:22 -07:00
libflate
libfmt_macros
libgetopts std: Stabilize APIs for the 1.9 release 2016-04-11 08:57:53 -07:00
libgraphviz sprinkle feature gates here and there 2016-03-22 22:02:47 -05:00
liblibc@7265c17d18 std: Fix linking against signal on Android 2016-04-04 21:54:59 -07:00
liblog
libpanic_abort rustc: Use C++ personalities on MSVC 2016-05-09 17:28:48 -07:00
libpanic_unwind rustc: Use C++ personalities on MSVC 2016-05-09 17:28:48 -07:00
librand Fix tests related to no_std 2016-05-03 18:51:19 +09:00
librbml std: Stabilize APIs for the 1.9 release 2016-04-11 08:57:53 -07:00
librustc Fixup indentation after methodification. 2016-05-11 08:48:12 +03:00
librustc_back Add #[cfg(target_has_atomic)] to get atomic support for the current target 2016-05-09 13:31:47 +01:00
librustc_bitflags
librustc_borrowck rustc: Split local type contexts interners from the global one. 2016-05-11 04:14:58 +03:00
librustc_const_eval rustc: Split local type contexts interners from the global one. 2016-05-11 04:14:58 +03:00
librustc_const_math don't report bitshift overflow twice 2016-04-26 14:10:07 +02:00
librustc_data_structures Make the codegen unit partitioner also emit item declarations. 2016-04-28 16:53:00 -04:00
librustc_driver rustc: Split local type contexts interners from the global one. 2016-05-11 04:14:58 +03:00
librustc_incremental rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users. 2016-05-11 04:14:58 +03:00
librustc_lint rustc: Split local type contexts interners from the global one. 2016-05-11 04:14:58 +03:00
librustc_llvm Add opt-level options for optimizing for size and minimum size. This attempts 2016-04-28 23:08:30 -07:00
librustc_metadata rustc: Remove the unnecessary ast_ty_to_ty_cache. 2016-05-11 04:14:58 +03:00
librustc_mir rustc: Split local type contexts interners from the global one. 2016-05-11 04:14:58 +03:00
librustc_passes rustc: Split local type contexts interners from the global one. 2016-05-11 04:14:58 +03:00
librustc_platform_intrinsics rustc_platform_intrinsics: remove unused rustc dependency. 2016-03-29 19:36:01 +03:00
librustc_plugin Remove the MacroVisitor pass. 2016-04-22 01:40:33 +02:00
librustc_privacy rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users. 2016-05-11 04:14:58 +03:00
librustc_resolve rustc: Remove the unnecessary ast_ty_to_ty_cache. 2016-05-11 04:14:58 +03:00
librustc_save_analysis rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users. 2016-05-11 04:14:58 +03:00
librustc_trans rustc: Split local type contexts interners from the global one. 2016-05-11 04:14:58 +03:00
librustc_typeck Fixup indentation after methodification. 2016-05-11 08:48:12 +03:00
librustc_unicode std: Stabilize APIs for the 1.9 release 2016-04-11 08:57:53 -07:00
librustdoc Auto merge of #33425 - eddyb:rift, r=nikomatsakis 2016-05-10 23:40:09 -07:00
libserialize Utilize Result::unwrap_err in more places. 2016-05-09 08:40:57 -04:00
libstd Auto merge of #32900 - alexcrichton:panic2abort, r=nikomatsakis 2016-05-09 18:23:48 -07:00
libsyntax Auto merge of #33443 - jseyfried:resolve_ast, r=nrc 2016-05-09 21:31:55 -07:00
libsyntax_ext Remove unused trait imports introduced while in review 2016-05-03 19:33:31 +09:00
libterm Utilize Result::unwrap_err in more places. 2016-05-09 08:40:57 -04:00
libtest rustc: Implement custom panic runtimes 2016-05-09 08:22:36 -07:00
libunwind rustc: Implement custom panic runtimes 2016-05-09 08:22:36 -07:00
llvm@a73c41e7f1 rustc: Use C++ personalities on MSVC 2016-05-09 17:28:48 -07:00
rt Handle integer-extending for C ABI 2016-04-04 22:14:10 +02:00
rtstartup Revert "workarounds to make link guards work on windows" 2016-03-25 14:07:20 -04:00
rust-installer@c37d3747da
rustc rustc: Implement custom panic runtimes 2016-05-09 08:22:36 -07:00
rustllvm rustc: Use C++ personalities on MSVC 2016-05-09 17:28:48 -07:00
test Auto merge of #33425 - eddyb:rift, r=nikomatsakis 2016-05-10 23:40:09 -07:00
tools rustc: Implement custom panic runtimes 2016-05-09 08:22:36 -07:00
stage0.txt mk: Bootstrap from stable instead of snapshots 2016-04-19 10:56:49 -07:00