rust/src
Jonas Schievink 6fcd589025
Rollup merge of #79000 - sivadeilra:user/ardavis/lev_distance, r=wesleywiser
Move lev_distance to rustc_ast, make non-generic

rustc_ast currently has a few dependencies on rustc_lexer. Ideally, an AST
would not have any dependency its lexer, for minimizing
design-time dependencies. Breaking this dependency would also have practical
benefits, since modifying rustc_lexer would not trigger a rebuild of rustc_ast.

This commit does not remove the rustc_ast --> rustc_lexer dependency,
but it does remove one of the sources of this dependency, which is the
code that handles fuzzy matching between symbol names for making suggestions
in diagnostics. Since that code depends only on Symbol, it is easy to move
it to rustc_span. It might even be best to move it to a separate crate,
since other tools such as Cargo use the same algorithm, and have simply
contain a duplicate of the code.

This changes the signature of find_best_match_for_name so that it is no
longer generic over its input. I checked the optimized binaries, and this
function was duplicated for nearly every call site, because most call sites
used short-lived iterator chains, generic over Map and such. But there's
no good reason for a function like this to be generic, since all it does
is immediately convert the generic input (the Iterator impl) to a concrete
Vec<Symbol>. This has all of the costs of generics (duplicated method bodies)
with no benefit.

Changing find_best_match_for_name to be non-generic removed about 10KB of
code from the optimized binary. I know it's a drop in the bucket, but we have
to start reducing binary size, and beginning to tame over-use of generics
is part of that.
2020-11-26 13:39:05 +01:00
..
bootstrap Auto merge of #79115 - cuviper:rust-description, r=Mark-Simulacrum 2020-11-21 15:43:09 +00:00
build_helper Fix even more URLs 2020-11-05 20:11:29 +01:00
ci Mirror centos vault to S3 2020-11-25 22:01:15 -05:00
doc Auto merge of #79336 - camelid:rename-feature-oibit-to-auto, r=oli-obk 2020-11-25 07:25:19 +00:00
etc BTreeMap: cut out the ceremony around BoxedNode 2020-11-23 17:02:08 +01:00
librustdoc Add summary_opts() for Markdown summary rendering options 2020-11-24 19:54:41 -08:00
llvm-project@ee16174578
test Rollup merge of #77758 - Stupremee:turbofish-help-for-const, r=varkor 2020-11-26 13:39:00 +01:00
tools Move lev_distance to rustc_ast, make non-generic 2020-11-24 16:12:23 -08:00
README.md
stage0.txt Bump bootstrap compiler version 2020-11-19 19:23:36 -05:00
version bump version to 1.50.0 2020-11-13 09:47:16 +01:00

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

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

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