rust/src/test
Tyler Mandry 1b182371e1
Rollup merge of #65410 - Centril:intersection-pat-recover, r=davidtwco,varkor
syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`

Fixes https://github.com/rust-lang/rust/issues/65400.

The recovery comes in two flavors:

1. We know that `p2` is a binding so we can invert as `p2 @ p1`:

```rust
error: pattern on wrong side of `@`
  --> $DIR/intersection-patterns.rs:13:9
   |
LL |         Some(x) @ y => {}
   |         -------^^^-
   |         |         |
   |         |         binding on the right, should be to the left
   |         pattern on the left, should be to the right
   |         help: switch the order: `y @ Some(x)`
```

2. Otherwise we emit a generic diagnostic for the lack of support for intersection patterns:

```rust
error: left-hand side of `@` must be a binding
  --> $DIR/intersection-patterns.rs:23:9
   |
LL |         Some(x) @ Some(y) => {}
   |         -------^^^-------
   |         |         |
   |         |         also a pattern
   |         interpreted as a pattern, not a binding
   |
   = note: bindings are `x`, `mut x`, `ref x`, and `ref mut x`
```

For more on and-patterns, see e.g. https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching#and-pattern.

r? @davidtwco
cc @varkor @lzutao
2019-10-14 17:52:42 -07:00
..
assembly
auxiliary
codegen make tests more robust 2019-10-12 23:08:57 +02:00
codegen-units rustc: Fix mixing crates with different share_generics 2019-09-23 12:29:51 -07:00
compile-fail Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton" 2019-10-05 21:38:45 -07:00
debuginfo fix debuginfo/issue22656 with LLDB 8 2019-09-18 10:42:55 -04:00
incremental Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton" 2019-10-05 21:38:45 -07:00
mir-opt Rollup merge of #64986 - skinny121:fn-ptr-const-generics, r=varkor 2019-10-11 15:09:42 -07:00
pretty Print visibility of macro items 2019-09-15 10:22:13 +01:00
run-fail [const-prop] Replace CheckedBinaryOp handling with use of InterpCx 2019-09-27 20:11:12 -04:00
run-make Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton" 2019-10-05 21:38:45 -07:00
run-make-fulldeps Rollup merge of #65369 - tmiasko:sanitizers-keep-names, r=varkor 2019-10-13 19:17:14 +02:00
run-pass-valgrind Remove no-prefer-dynamic from valgrind tests 2019-09-01 10:09:45 -04:00
rustdoc rustc: rely on c_variadic == true instead of CVarArgs in HIR/Ty fn signatures. 2019-09-28 17:39:00 +03:00
rustdoc-js Improve searching in rustdoc and add tests 2019-09-04 21:27:13 +08:00
rustdoc-js-std Improve searching in rustdoc and add tests 2019-09-04 21:27:13 +08:00
rustdoc-ui Add and update rustdoc ui test 2019-10-10 11:37:13 +02:00
rustfix
ui Rollup merge of #65410 - Centril:intersection-pat-recover, r=davidtwco,varkor 2019-10-14 17:52:42 -07:00
ui-fulldeps --bless ui-fulldeps tests 2019-10-03 09:33:28 +02:00
COMPILER_TESTS.md