rust/src
Zack M. Davis 1f04597c3c in which parentheses are suggested for should-have-been-tuple-patterns
Programmers used to working in some other languages (such as Python or
Go) might expect to be able to destructure values with comma-separated
identifiers but no parentheses on the left side of an assignment.

Previously, the first name in such code would get parsed as a
single-indentifier pattern—recognizing, for example, the
`let a` in `let a, b = (1, 2);`—whereupon we would have a fatal syntax
error on seeing an unexpected comma rather than the expected semicolon
(all the way nearer to the end of `parse_full_stmt`).

Instead, let's look for that comma when parsing the pattern, and if we
see it, momentarily make-believe that we're parsing the remaining
elements in a tuple pattern, so that we can suggest wrapping it all in
parentheses. We need to do this in a separate wrapper method called on
the top-level pattern (or `|`-patterns) in a `let` statement, `for`
loop, `if`- or `while let` expression, or match arm rather than within
`parse_pat` itself, because `parse_pat` gets called recursively to parse
the sub-patterns within a tuple pattern.

Resolves #48492.
2018-03-08 11:30:34 -08:00
..
bootstrap appveyor: Fix a switched condition for cargotest 2018-03-07 17:00:27 -08:00
build_helper
ci appveyor: Shard more slow MSVC builders 2018-03-07 07:29:44 -08:00
dlmalloc@9b2dcac06c Update the dlmalloc submodule 2018-02-10 07:01:27 -08:00
doc Stabilize const_indexing feature 2018-03-08 08:34:14 +01:00
etc Remove unused 'src/etc/ziggurat_tables.py' Python script. 2018-03-06 19:35:16 -05:00
grammar
jemalloc@1f5a28755e
liballoc Rollup merge of #47463 - bluss:fused-iterator, r=alexcrichton 2018-03-06 20:52:37 +08:00
liballoc_jemalloc Make liballoc_jemalloc work on CloudABI. 2018-01-18 21:11:24 +01:00
liballoc_system
libarena
libbacktrace fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
libcompiler_builtins@266ea0740a Update compiler-builtins to latest master. 2018-02-13 22:39:11 +01:00
libcore Produce instead of pointers 2018-03-08 08:08:14 +01:00
libfmt_macros fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
libgetopts
libgraphviz
liblibc@56444a4545 Revert unintentional submodule updates 2018-02-18 00:21:33 +09:00
libpanic_abort rustc: Add an option to default hidden visibility 2018-01-30 13:41:20 -08:00
libpanic_unwind make #[unwind] attribute specify expectations more clearly 2018-02-20 19:12:52 -05:00
libproc_macro Impl !Send and !Sync for SourceFile 2018-03-02 10:48:52 +01:00
libprofiler_builtins
librustc Regenerate tests 2018-03-08 08:35:38 +01:00
librustc_allocator Fix up tests and typos 2018-02-18 00:10:40 +09:00
librustc_apfloat fix more typos found by codespell. 2018-02-17 17:38:49 +01:00
librustc_asan
librustc_back rustc: Tweak default linker selection 2018-03-03 20:21:35 -08:00
librustc_borrowck Turn features() into a query. 2018-03-05 11:05:01 +01:00
librustc_const_eval Move librustc_const_eval to librustc_mir 2018-03-08 08:08:14 +01:00
librustc_const_math Nuke ConstInt and Const*size 2018-03-08 08:34:10 +01:00
librustc_cratesio_shim
librustc_data_structures Produce instead of pointers 2018-03-08 08:08:14 +01:00
librustc_driver Regenerate tests 2018-03-08 08:35:38 +01:00
librustc_errors Replace Rc with Lrc for shared data 2018-03-02 10:48:52 +01:00
librustc_incremental Turn features() into a query. 2018-03-05 11:05:01 +01:00
librustc_lint Clean up the binary hex lint 2018-03-08 08:35:39 +01:00
librustc_llvm Fully use miri in trans 2018-03-08 08:34:05 +01:00
librustc_lsan
librustc_metadata Hide the RefCell inside InterpretInterner 2018-03-08 08:34:09 +01:00
librustc_mir simplify constant value pair field access 2018-03-08 08:35:39 +01:00
librustc_msan
librustc_passes Regenerate tests 2018-03-08 08:35:38 +01:00
librustc_platform_intrinsics
librustc_plugin Turn features() into a query. 2018-03-05 11:05:01 +01:00
librustc_privacy Replace Rc with Lrc for shared data 2018-03-02 10:48:52 +01:00
librustc_resolve Turn features() into a query. 2018-03-05 11:05:01 +01:00
librustc_save_analysis Do not panic on tuple struct access out of bounds 2018-03-07 08:48:36 +09:00
librustc_trans Unregress error spans in constant errors 2018-03-08 08:34:17 +01:00
librustc_trans_utils Merge branch 'incr_attr_queries' of https://github.com/wesleywiser/rust into update-cargo 2018-03-07 07:13:21 -08:00
librustc_tsan
librustc_typeck Remove unused error code 2018-03-08 08:35:38 +01:00
librustdoc Deduplicate code in rustdoc 2018-03-08 08:34:13 +01:00
libserialize Fix Decodable impl for Arc 2018-03-02 10:45:32 +01:00
libstd Rollup merge of #48618 - scottmcm:elaborate-exitcode, r=alexcrichton 2018-03-06 23:38:06 -08:00
libstd_unicode Rollup merge of #47463 - bluss:fused-iterator, r=alexcrichton 2018-03-06 20:52:37 +08:00
libsyntax in which parentheses are suggested for should-have-been-tuple-patterns 2018-03-08 11:30:34 -08:00
libsyntax_ext while let all the things 2018-03-05 15:58:54 -03:00
libsyntax_pos Don't derive traits on packed structs 2018-03-08 08:35:39 +01:00
libterm
libtest re-export assert_test_result for use when testing libtest itself 2018-02-23 10:11:06 -05:00
libunwind make #[unwind] attribute specify expectations more clearly 2018-02-20 19:12:52 -05:00
llvm@0903c72cbb rustc: Update LLVM 2018-03-06 08:45:12 -08:00
llvm-emscripten@2717444753 rustc: Split Emscripten to a separate codegen backend 2018-01-28 18:32:45 -08:00
rtstartup
rustc rustc: Load the rustc_trans crate at runtime 2018-01-27 19:16:21 -08:00
rustllvm rustc: Update LLVM 2018-03-06 08:45:12 -08:00
stdsimd@678cbd325c std: Add arch and simd modules 2018-03-02 14:34:07 -08:00
test in which parentheses are suggested for should-have-been-tuple-patterns 2018-03-08 11:30:34 -08:00
tools Merge branch 'compiletest-update' of https://github.com/alexcrichton/rust into update-cargo 2018-03-07 07:11:57 -08:00
Cargo.lock Regenerate tests 2018-03-08 08:35:38 +01:00
Cargo.toml Convert python script to rust 2018-02-08 10:53:09 +01:00
README.md Start moving to the rustc guide! 2018-02-23 13:20:56 -06:00
stage0.txt Bootstrap from the 1.25 beta 2018-02-20 08:52:33 -07: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.

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