rust/src/test
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
..
auxiliary Remove directory src/rt 2018-02-24 16:45:39 +03:00
codegen Adjust test which differs between 32 bit and 64 bit 2018-03-08 08:35:38 +01:00
codegen-units Convert codegen-unit tests to use start instead of main 2017-12-26 12:26:39 +01:00
compile-fail Unify the const folding errors 2018-03-08 08:35:39 +01:00
compile-fail-fulldeps Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
debuginfo Debuginfo Shadowed Variable test: fix check numbering 2018-01-06 11:10:17 +00:00
incremental incr.comp.: Add regression test for detecting feature gate changes. 2018-03-05 11:05:01 +01:00
incremental-fulldeps Add incremental-fulldeps test suite and regression test for #47290. 2018-01-16 19:31:15 +01:00
mir-opt Rebase fallout 2018-03-08 08:34:17 +01:00
parse-fail Support parentheses in patterns under feature gate 2018-03-01 01:47:56 +03:00
pretty fix more typos found by codespell. 2018-02-17 17:38:49 +01:00
run-fail add test for fn main() -> ! 2018-02-22 20:10:36 -05:00
run-fail-fulldeps
run-make Do not panic on tuple struct access out of bounds 2018-03-07 08:48:36 +09:00
run-pass Don't use the undefined bytes of PrimVal::Bytes 2018-03-08 08:34:18 +01:00
run-pass-fulldeps Fix procedural_mbe_matching test case after libsyntax change. 2018-03-05 11:05:01 +01:00
run-pass-valgrind Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI. 2018-01-02 14:11:41 +01:00
rustdoc Rollup merge of #48473 - GuillaumeGomez:rustdoc-auto-trait-impl-fix, r=QuietMisdreavus 2018-02-28 19:15:33 +08:00
rustdoc-js Merge branch 'rustdoc_masked' of https://github.com/ollie27/rust into rollup 2018-01-26 06:51:58 -08:00
ui in which parentheses are suggested for should-have-been-tuple-patterns 2018-03-08 11:30:34 -08:00
ui-fulldeps Fix rebase 2018-02-26 21:20:31 +03:00
COMPILER_TESTS.md A few small improvements to the contributing docs 2017-12-20 22:18:13 +02:00