rust/src
Mazdak Farrokhzad bab03cecfe
Rollup merge of #60130 - khuey:efficient_last, r=sfackler
Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators

Provided a `DoubleEndedIterator` has finite length, `Iterator::last` is equivalent to `DoubleEndedIterator::next_back`. But searching forwards through the iterator when it's unnecessary is obviously not good for performance. I ran into this on one of the collection iterators.

I tried adding appropriate overloads for a bunch of the iterator adapters like filter, map, etc, but I ran into a lot of type inference failures after doing so.

The other interesting case is what to do with `Repeat`. Do we consider it part of the contract that `Iterator::last` will loop forever on it? The docs do say that the iterator will be evaluated until it returns None. This is also relevant for the adapters, it's trivially easy to observe whether a `Map` adapter invoked its closure a zillion times or just once for the last element.
2019-05-14 22:00:09 +02:00
..
bootstrap Make tests compatible with musl host 2019-05-10 16:12:47 +02:00
build_helper
ci Conditionally provide cc in musl-toolchain.sh 2019-05-10 16:12:47 +02:00
doc Update cargo, books 2019-04-23 21:39:27 -07:00
etc
grammar
liballoc Rollup merge of #60130 - khuey:efficient_last, r=sfackler 2019-05-14 22:00:09 +02:00
libarena Deny internal in stage0 2019-04-17 05:15:00 +02:00
libcore Rollup merge of #60130 - khuey:efficient_last, r=sfackler 2019-05-14 22:00:09 +02:00
libfmt_macros Deny internal in stage0 2019-04-17 05:15:00 +02:00
libgraphviz
libpanic_abort
libpanic_unwind Stabilize the alloc crate. 2019-04-12 20:07:30 +02:00
libproc_macro proc_macro: stop using LEB128 for RPC. 2019-04-09 21:05:15 +03:00
libprofiler_builtins libprofiler_builtins: Set compilation flags more correctly for C code. 2019-05-08 17:02:58 +02:00
librustc Auto merge of #60765 - matthewjasper:fix-more-escaping-rescopes, r=oli-obk 2019-05-13 08:13:01 +00:00
librustc_allocator Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_apfloat ignore-tidy-filelength on all files with greater than 3000 lines 2019-04-25 21:39:09 +01:00
librustc_asan Update cmake, cc and compiler_builtins for VS 2019 support 2019-04-10 21:17:31 +02:00
librustc_borrowck Auto merge of #60195 - varkor:commontypes-to-common, r=eddyb 2019-05-01 09:32:58 +00:00
librustc_codegen_llvm Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_codegen_ssa Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_codegen_utils Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_cratesio_shim
librustc_data_structures Delegate SmallVec's stable_hash to array's stable_hash. 2019-05-04 20:29:35 +02:00
librustc_driver Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_errors Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match. 2019-05-10 19:41:10 +02:00
librustc_fs_util
librustc_incremental Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_interface Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_lint Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
librustc_llvm
librustc_lsan Update cmake, cc and compiler_builtins for VS 2019 support 2019-04-10 21:17:31 +02:00
librustc_macros Add lots of static Symbols. 2019-05-13 09:26:43 +10:00
librustc_metadata Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
librustc_mir Rollup merge of #60176 - matthewjasper:yield-ref-to-local, r=pnkfelix 2019-05-13 21:36:49 +02:00
librustc_msan Update cmake, cc and compiler_builtins for VS 2019 support 2019-04-10 21:17:31 +02:00
librustc_passes Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov 2019-05-13 00:28:38 +00:00
librustc_plugin Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
librustc_privacy Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_resolve Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
librustc_save_analysis Auto merge of #60649 - Xanewok:save-analysis-assoc-const-ice, r=oli-obk 2019-05-13 10:57:59 +00:00
librustc_target Omit the vendor component in the WASI triple 2019-05-09 11:35:10 -07:00
librustc_traits Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
librustc_tsan Update cmake, cc and compiler_builtins for VS 2019 support 2019-04-10 21:17:31 +02:00
librustc_typeck Rollup merge of #60710 - varkor:delay_span_bug-const-parent, r=matthewjasper 2019-05-13 21:36:54 +02:00
librustdoc Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
libserialize serialize: add missing Encodable impl for Path. 2019-05-07 02:47:45 +03:00
libstd Rollup merge of #60130 - khuey:efficient_last, r=sfackler 2019-05-14 22:00:09 +02:00
libsyntax add impl_trait_in_bindings to INCOMPLETE_FEATURES 2019-05-13 18:45:20 +03:00
libsyntax_ext Rollup merge of #60562 - iliekturtles:proc-macro-missing-docs, r=alexcrichton 2019-05-13 21:36:52 +02:00
libsyntax_pos Remove the equality operation between Symbol and strings. 2019-05-13 09:31:30 +10:00
libterm Revert "Auto merge of #57842 - gnzlbg:extract_libtest, r=gnzlbg" 2019-04-07 03:16:31 -04:00
libtest Update getopts to 0.2.19 2019-05-05 10:45:10 +01:00
libunwind Support using LLVM's libunwind as the unwinder implementation 2019-04-03 11:21:40 -07:00
llvm-emscripten@7f23313edf
llvm-project@84abffda0e Support using LLVM's libunwind as the unwinder implementation 2019-04-03 11:21:40 -07:00
rtstartup
rustc Remove leading newlines 2019-04-22 17:01:33 +01:00
rustllvm Limit internalization in LLVM 8 ThinLTO 2019-04-26 08:58:14 -07:00
stdsimd@4bf456c35e Breaking update of stdsimd 2019-04-22 09:07:25 +02:00
test Rollup merge of #60770 - Pulkit07:issue60764, r=Centril 2019-05-13 21:36:55 +02:00
tools Auto merge of #60474 - mati865:musl_toolchain, r=alexcrichton 2019-05-12 09:19:28 +00:00
.gitignore
README.md
stage0.txt bump bootstrap => 2019-04-11 2019-04-17 05:15:00 +02:00

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.

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