rust/src
Aaron Hill 5e2856122a
Properly handle Spans that reference imported SourceFiles
Previously, metadata encoding used DUMMY_SP to represent any spans that
referenced an 'imported' SourceFile - e.g. a SourceFile from an upstream
dependency. These leads to sub-optimal error messages in certain cases
(see the included test).

This PR changes how we encode and decode spans in crate metadata. We
encode spans in one of two ways:

* 'Local' spans, which reference non-imported SourceFiles, are encoded
  exactly as before.
* 'Foreign' spans, which reference imported SourceFiles, are encoded
  with the CrateNum of their 'originating' crate. Additionally, their
'lo' and 'high' values are rebased on top of the 'originating' crate,
which allows them to be used with the SourceMap data encoded for that
crate.

The `ExternalSource` enum is renamed to `ExternalSourceKind`. There is
now a struct called `ExternalSource`, which holds an
`ExternalSourceKind` along with the original line number information for
the file. This is used during `Span` serialization to rebase spans onto
their 'owning' crate.
2020-03-18 23:56:42 -04:00
..
bootstrap Tidy: fix running rustfmt twice 2020-03-18 08:15:29 -07:00
build_helper
ci ci: use python from the correct path 2020-03-18 21:07:44 +01:00
doc Update books 2020-03-16 19:09:54 -07:00
etc
liballoc Rollup merge of #70029 - jonas-schievink:bootstrap, r=Centril 2020-03-17 03:05:17 +01:00
libarena
libcore Auto merge of #68915 - timvermeulen:non_fused_iter, r=Amanieu 2020-03-18 03:08:52 +00:00
libfmt_macros fix various typos 2020-03-06 15:19:31 +01:00
libgraphviz
libpanic_abort Simplify the try intrinsic by using a callback in the catch block 2020-03-05 17:36:50 +00:00
libpanic_unwind fix pre-expansion linting infra 2020-03-18 15:08:25 +01:00
libproc_macro Use min_specialization in libstd and libproc_macro 2020-03-15 13:23:03 +00:00
libprofiler_builtins
librustc Properly handle Spans that reference imported SourceFiles 2020-03-18 23:56:42 -04:00
librustc_apfloat
librustc_ast Rollup merge of #69899 - ecstatic-morse:const-idx-methods, r=oli-obk 2020-03-18 18:03:42 +01:00
librustc_ast_lowering Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_ast_passes Auto merge of #68970 - matthewjasper:min-spec, r=nikomatsakis 2020-03-16 20:49:26 +00:00
librustc_ast_pretty Don't prepend with space before paren 2020-03-17 18:29:20 +01:00
librustc_attr Other legacy -> macro_rules 2020-03-16 00:29:42 +03:00
librustc_builtin_macros fix pre-expansion linting infra 2020-03-18 15:08:25 +01:00
librustc_codegen_llvm Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_codegen_ssa Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_codegen_utils Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_data_structures Bump the bootstrap compiler 2020-03-15 19:43:25 +01:00
librustc_driver use direct imports for rustc::{lint, session}. 2020-03-16 02:52:06 +01:00
librustc_error_codes Rollup merge of #69139 - GuillaumeGomez:cleanup-e0308, r=Dylan-DPC 2020-03-18 18:03:33 +01:00
librustc_errors use direct imports for rustc::{lint, session}. 2020-03-16 02:52:06 +01:00
librustc_expand fix pre-expansion linting infra 2020-03-18 15:08:25 +01:00
librustc_feature Rollup merge of #69870 - petrochenkov:cfgacc, r=matthewjasper 2020-03-17 03:05:12 +01:00
librustc_fs_util
librustc_hir Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_incremental Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_index Add requisite feature gates for const assert 2020-03-17 11:15:40 -07:00
librustc_infer Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_interface Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_lexer fix various typos 2020-03-06 15:19:31 +01:00
librustc_lint Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_llvm use char instead of &str for single char patterns 2020-02-27 14:57:22 +01:00
librustc_macros Auto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddyb 2020-03-10 17:12:48 +00:00
librustc_metadata Properly handle Spans that reference imported SourceFiles 2020-03-18 23:56:42 -04:00
librustc_mir Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_mir_build Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_parse fix rebase fallout 2020-03-18 15:08:25 +01:00
librustc_passes Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_plugin_impl use direct imports for rustc::{lint, session}. 2020-03-16 02:52:06 +01:00
librustc_privacy Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_resolve Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_save_analysis use direct imports for rustc::{lint, session}. 2020-03-16 02:52:06 +01:00
librustc_session Auto merge of #69519 - 12101111:remove-proc-macro-check, r=nagisa 2020-03-17 18:27:26 +00:00
librustc_span Properly handle Spans that reference imported SourceFiles 2020-03-18 23:56:42 -04:00
librustc_target Add requisite feature gates for const assert 2020-03-17 11:15:40 -07:00
librustc_trait_selection Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustc_traits More Method->Fn renaming 2020-03-15 19:15:55 -05:00
librustc_ty use direct imports for rustc::{lint, session}. 2020-03-16 02:52:06 +01:00
librustc_typeck Rollup merge of #69920 - Centril:hir-cleanup, r=Zoxc 2020-03-18 18:03:44 +01:00
librustdoc Rollup merge of #70075 - GuillaumeGomez:fix-repr-display, r=petrochenkov 2020-03-18 18:03:47 +01:00
libserialize Inline various simple emit_* and read_* methods in Decoder. 2020-02-18 16:46:50 +11:00
libstd Rollup merge of #67749 - gilescope:keyword-in, r=Dylan-DPC 2020-03-18 18:03:31 +01:00
libterm
libtest Rollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPC 2020-03-14 04:03:24 +09:00
libunwind Link to libgcc dynamically on windows-gnu when using dylib crates 2020-03-05 17:36:50 +00:00
llvm-project@9f65ad0573 update llvm to silence gcc 9 warnings 2020-02-26 10:27:01 +08:00
rtstartup Fix MinGW termination callbacks not being invoked 2020-03-05 17:36:50 +00:00
rustc
rustllvm librustc_codegen_llvm: Use slices instead of 0-terminated strings 2020-03-11 08:10:21 +01:00
stdarch@dea57529b3
test Properly handle Spans that reference imported SourceFiles 2020-03-18 23:56:42 -04:00
tools Update cargo 2020-03-17 20:33:07 -07:00
README.md rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org 2020-03-10 17:08:18 -03:00
stage0.txt Bump the bootstrap compiler 2020-03-15 19:43:25 +01: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 dev guide.