rust/src
David Tolnay c5a561c0ab
proc_macro::Group::span_open and span_close
Before this addition, every delimited group like (...) [...] {...} has
only a single Span that covers the full source location from opening
delimiter to closing delimiter. This makes it impossible for a
procedural macro to trigger an error pointing to just the opening or
closing delimiter. The Rust compiler does not seem to have the same
limitation:

    mod m {
        type T =
    }

    error: expected type, found `}`
     --> src/main.rs:3:1
      |
    3 | }
      | ^

On that same input, a procedural macro would be forced to trigger the
error on the last token inside the block, on the entire block, or on the
next token after the block, none of which is really what you want for an
error like above.

This commit adds group.span_open() and group.span_close() which access
the Span associated with just the opening delimiter and just the closing
delimiter of the group. Relevant to Syn as we implement real error
messages for when parsing fails in a procedural macro.
2018-09-02 14:34:45 -07:00
..
bootstrap Rollup merge of #53076 - QuietMisdreavus:cfg-rustdoc, r=GuillaumeGomez 2018-09-01 23:18:41 +08:00
build_helper
ci [RISCV] Add riscv32imc-unknown-none-elf target. 2018-08-30 16:03:37 +02:00
dlmalloc@c99638dc2e
doc Rollup merge of #53076 - QuietMisdreavus:cfg-rustdoc, r=GuillaumeGomez 2018-09-01 23:18:41 +08:00
etc Fix direction of slashes in the help text example. 2018-08-30 20:23:41 +01:00
grammar
jemalloc@1f5a28755e
liballoc Auto merge of #53884 - kennytm:rollup, r=kennytm 2018-09-01 15:48:21 +00:00
liballoc_jemalloc
liballoc_system Replace usages of 'bad_style' with 'nonstandard_style'. 2018-08-29 09:01:35 -05:00
libarena
libbacktrace@f4d02bbdbf
libcompiler_builtins@f3a13eb238 Update LLVM submodule 2018-08-31 16:00:41 -07:00
libcore Auto merge of #53884 - kennytm:rollup, r=kennytm 2018-09-01 15:48:21 +00:00
libfmt_macros
libgraphviz
liblibc@1844a772b6
libpanic_abort
libpanic_unwind Replace usages of 'bad_style' with 'nonstandard_style'. 2018-08-29 09:01:35 -05:00
libproc_macro proc_macro::Group::span_open and span_close 2018-09-02 14:34:45 -07:00
libprofiler_builtins
librustc Auto merge of #53887 - flip1995:tool_lints, r=Manishearth 2018-09-02 02:10:33 +00:00
librustc_allocator
librustc_apfloat
librustc_asan
librustc_borrowck
librustc_codegen_llvm Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelix 2018-08-30 20:15:29 +02:00
librustc_codegen_utils
librustc_cratesio_shim
librustc_data_structures Rollup merge of #53786 - frewsxcv:frewsxcv-bad-style, r=Manishearth 2018-08-30 20:15:47 +02:00
librustc_driver Add deprecated_name argument to the register lint group functions 2018-08-31 00:46:55 -07:00
librustc_errors Rollup merge of #53786 - frewsxcv:frewsxcv-bad-style, r=Manishearth 2018-08-30 20:15:47 +02:00
librustc_fs_util
librustc_incremental
librustc_lint Add deprecated_name argument to the register lint group functions 2018-08-31 00:46:55 -07:00
librustc_llvm
librustc_lsan
librustc_metadata Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelix 2018-08-30 20:15:29 +02:00
librustc_metadata_utils
librustc_mir Auto merge of #53842 - estebank:various, r=petrochenkov 2018-09-01 23:34:14 +00:00
librustc_msan
librustc_passes Auto merge of #53815 - F001:if-let-guard, r=petrochenkov 2018-09-01 20:31:29 +00:00
librustc_platform_intrinsics Replace usages of 'bad_style' with 'nonstandard_style'. 2018-08-29 09:01:35 -05:00
librustc_plugin Add deprecated_name argument to the register lint group functions 2018-08-31 00:46:55 -07:00
librustc_privacy
librustc_resolve Auto merge of #53815 - F001:if-let-guard, r=petrochenkov 2018-09-01 20:31:29 +00:00
librustc_save_analysis Auto merge of #53842 - estebank:various, r=petrochenkov 2018-09-01 23:34:14 +00:00
librustc_target Auto merge of #53604 - oli-obk:min_const_fn, r=Centril,varkor 2018-09-01 11:26:24 +00:00
librustc_traits
librustc_tsan
librustc_typeck Auto merge of #53842 - estebank:various, r=petrochenkov 2018-09-01 23:34:14 +00:00
librustdoc Rollup merge of #53076 - QuietMisdreavus:cfg-rustdoc, r=GuillaumeGomez 2018-09-01 23:18:41 +08:00
libserialize
libstd Auto merge of #53533 - withoutboats:error-source, r=withoutboats 2018-09-01 18:08:45 +00:00
libsyntax Auto merge of #53815 - F001:if-let-guard, r=petrochenkov 2018-09-01 20:31:29 +00:00
libsyntax_ext
libsyntax_pos
libterm
libtest Replace usages of 'bad_style' with 'nonstandard_style'. 2018-08-29 09:01:35 -05:00
libunwind Replace usages of 'bad_style' with 'nonstandard_style'. 2018-08-29 09:01:35 -05:00
llvm@2a1cdeadd3 Update LLVM submodule 2018-08-31 16:00:41 -07:00
llvm-emscripten@2717444753
rtstartup
rustc
rustllvm Update LLVM submodule 2018-08-31 16:00:41 -07:00
stdsimd@05c2f61c38
test Auto merge of #53887 - flip1995:tool_lints, r=Manishearth 2018-09-02 02:10:33 +00:00
tools Auto merge of #53822 - dvc94ch:riscv, r=japaric 2018-09-01 06:58:16 +00:00
.gitignore
Cargo.lock Update clippy submodule 2018-08-29 13:15:55 +02:00
Cargo.toml
README.md
stage0.txt

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: