rust/src
bors 31b97f789f Auto merge of #55069 - matthewjasper:explain-free-region-liveness, r=nikomatsakis
[NLL] Use new region infer errors when explaining borrows

Use the new free region infer errors for explaining borrows

This gives at least some explanation for why a borrow is expected to
last for a certain free region. Also:

* Reports E0373: "closure may outlive the current function" with NLL.
* Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515).
* Special case assigning a reference to a local variable in a closure to a captured variable. (E0521)

Closes #51026 - `regions-nested-fns-2.rs` isn't changed to that diagnostic, since that would not be the correct error here.
Closes #51169
cc #53882 - The error is (IMO) better now, but it could be better when we trace lifetimes in these error messages.

r? @nikomatsakis cc @pnkfelix
2018-10-21 12:04:25 +00:00
..
bootstrap Update Cargo, build curl/OpenSSL statically via features 2018-10-20 18:47:01 -07:00
build_helper Prefer unwrap_or_else to unwrap_or in case of function calls/allocations 2018-10-19 09:45:45 +02:00
ci Update Cargo, build curl/OpenSSL statically via features 2018-10-20 18:47:01 -07:00
dlmalloc@c99638dc2e
doc update books for the next release 2018-10-20 07:47:32 -04:00
etc Rollup merge of #54989 - Munksgaard:fix-htmldocck-typos, r=tmandry 2018-10-12 22:04:19 +08:00
grammar
jemalloc@1f5a28755e
liballoc Stabilize slice::rchunks(), rchunks_mut(), rchunks_exact(), rchunk_exact_mut() 2018-10-18 18:51:56 +03:00
liballoc_jemalloc Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
liballoc_system std: Synchronize global allocator on wasm32 2018-10-09 23:35:45 -07:00
libarena Update TypedArena tests 2018-10-19 14:34:44 +02:00
libbacktrace@f4d02bbdbf
libcompiler_builtins@0703bfa725 Revert "renamed emit_nil to emit_unit" 2018-09-11 22:20:22 +09:00
libcore Rollup merge of #55178 - sdroege:stabilize-chunks-exact, r=alexcrichton 2018-10-19 16:47:55 +08:00
libfmt_macros remove padding from multiline format string label 2018-10-03 14:29:39 -04:00
libgraphviz Remove graphviz::IntoCow 2018-10-05 14:16:10 +02:00
liblibc@1844a772b6 Revert "renamed emit_nil to emit_unit" 2018-09-11 22:20:22 +09:00
libpanic_abort wasm: Explicitly export all symbols with LLD 2018-10-02 13:49:51 -07:00
libpanic_unwind Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
libproc_macro All `proc_macro_span` APIs tracked at #54725 now 2018-10-01 12:15:35 -07:00
libprofiler_builtins Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
librustc Auto merge of #55069 - matthewjasper:explain-free-region-liveness, r=nikomatsakis 2018-10-21 12:04:25 +00:00
librustc_allocator Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
librustc_apfloat Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
librustc_asan Rollup merge of #54681 - alexcrichton:san-names, r=kennytm 2018-10-01 16:13:04 +08:00
librustc_borrowck Prefer `Default::default` over `FxHash*::default` in struct constructors 2018-10-19 14:34:44 +02:00
librustc_codegen_llvm Rollup merge of #55073 - alexcrichton:demote-simd, r=nagisa 2018-10-20 13:15:39 -07:00
librustc_codegen_utils Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper 2018-10-20 11:22:48 +00:00
librustc_cratesio_shim Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
librustc_data_structures Update unit tests 2018-10-19 14:34:45 +02:00
librustc_driver Prefer unwrap_or_else to unwrap_or in case of function calls/allocations 2018-10-19 09:45:45 +02:00
librustc_errors Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper 2018-10-20 11:22:48 +00:00
librustc_fs_util
librustc_incremental Prefer `Default::default` over `FxHash*::default` in struct constructors 2018-10-19 14:34:44 +02:00
librustc_lint Auto merge of #55114 - oli-obk:fx#map, r=nikomatsakis 2018-10-20 08:45:55 +00:00
librustc_llvm rustc: Fix (again) simd vectors by-val in ABI 2018-10-19 02:35:00 -07:00
librustc_lsan Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
librustc_metadata Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper 2018-10-20 11:22:48 +00:00
librustc_metadata_utils
librustc_mir Auto merge of #55069 - matthewjasper:explain-free-region-liveness, r=nikomatsakis 2018-10-21 12:04:25 +00:00
librustc_msan Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
librustc_passes Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hack 2018-10-19 14:34:44 +02:00
librustc_platform_intrinsics Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
librustc_plugin Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
librustc_privacy Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hack 2018-10-19 14:34:44 +02:00
librustc_resolve Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper 2018-10-20 11:22:48 +00:00
librustc_save_analysis Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper 2018-10-20 11:22:48 +00:00
librustc_target rustc: Allow targets to specify SIMD args are by-val 2018-10-12 17:04:31 -07:00
librustc_traits Rollup merge of #55203 - scalexm:program-clauses, r=nikomatsakis 2018-10-20 13:15:48 -07:00
librustc_tsan Rollup merge of #54681 - alexcrichton:san-names, r=kennytm 2018-10-01 16:13:04 +08:00
librustc_typeck Auto merge of #55156 - PramodBisht:issue/52717, r=estebank 2018-10-20 19:45:53 +00:00
librustdoc Prefer `Default::default` over `FxHash*::default` in struct constructors 2018-10-19 14:34:44 +02:00
libserialize Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
libstd Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper 2018-10-20 11:22:48 +00:00
libsyntax Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasper 2018-10-20 11:22:48 +00:00
libsyntax_ext expansion: Remove restriction on use of macro attributes with test/bench 2018-10-05 11:40:40 +04:00
libsyntax_pos Prefer `Default::default` over `FxHash*::default` in struct constructors 2018-10-19 14:34:44 +02:00
libterm Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
libtest Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
libunwind Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
llvm@caddcd9b9d Update LLVM to fix "bool" arguments on PPC32 2018-09-16 04:33:58 +08:00
llvm-emscripten@2717444753
rtstartup
rustc
rustllvm Rollup merge of #55073 - alexcrichton:demote-simd, r=nagisa 2018-10-20 13:15:39 -07:00
stdsimd@307650500d Update stdsimd submodule 2018-10-09 14:21:42 -07:00
test Auto merge of #55069 - matthewjasper:explain-free-region-liveness, r=nikomatsakis 2018-10-21 12:04:25 +00:00
tools Auto merge of #55125 - RalfJung:stacked-borrows, r=oli-obk 2018-10-21 09:32:25 +00:00
.gitignore
Cargo.lock Update Cargo, build curl/OpenSSL statically via features 2018-10-20 18:47:01 -07:00
Cargo.toml Use rls-data 0.18.1 2018-09-28 01:54:01 +02:00
README.md
stage0.txt bump bootstrap compiler to rustc beta 2018-10-13 2018-10-14 00:52:47 +02:00

README.md

This directory contains the source code of the rust project, including:

  • rustc and its tests
  • libstd
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc guide.

Their is also useful content in the following READMEs, which are gradually being moved over to the guide: