diff options
| author | bors <bors@rust-lang.org> | 2021-03-09 09:43:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-03-09 09:43:55 +0000 |
| commit | 3a5d45f68cadc8fff4fbb557780f92b403b19c19 (patch) | |
| tree | 2d80555f16636c76ee9e5d452078c13f19cc1f4a /src/test/ui/or-patterns/missing-bindings.rs | |
| parent | 4b9f5cc4c10a161047475cb9bbe02c4fda57fb07 (diff) | |
| parent | 74de9db0ce515a26171c441cd808e6d872010f86 (diff) | |
Auto merge of #82929 - m-ou-se:rollup-7fwrewh, r=m-ou-se
Rollup of 8 pull requests Successful merges: - #81127 (Improve sift_down performance in BinaryHeap) - #81879 (Added #[repr(transparent)] to core::cmp::Reverse) - #82048 (or-patterns: disallow in `let` bindings) - #82731 (Bump libc dependency of std to 0.2.88.) - #82799 (Add regression test for #75525) - #82841 (Change x64 size checks to not apply to x32.) - #82883 (Update Cargo) - #82887 (Update CONTRIBUTING.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui/or-patterns/missing-bindings.rs')
| -rw-r--r-- | src/test/ui/or-patterns/missing-bindings.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/ui/or-patterns/missing-bindings.rs b/src/test/ui/or-patterns/missing-bindings.rs index 67cf52fa8c4..5dd1f16b655 100644 --- a/src/test/ui/or-patterns/missing-bindings.rs +++ b/src/test/ui/or-patterns/missing-bindings.rs @@ -17,7 +17,7 @@ fn check_handling_of_paths() { } use bar::foo::{alpha, charlie}; - let alpha | beta | charlie = alpha; //~ ERROR variable `beta` is not bound in all patterns + let (alpha | beta | charlie) = alpha; //~ ERROR variable `beta` is not bound in all patterns match Some(alpha) { Some(alpha | beta) => {} //~ ERROR variable `beta` is not bound in all patterns } @@ -31,19 +31,19 @@ fn check_misc_nesting() { // One level: const X: E<u8> = B(0); - let A(a, _) | _ = X; //~ ERROR variable `a` is not bound in all patterns - let _ | B(a) = X; //~ ERROR variable `a` is not bound in all patterns - let A(..) | B(a) = X; //~ ERROR variable `a` is not bound in all patterns - let A(a, _) | B(_) = X; //~ ERROR variable `a` is not bound in all patterns - let A(_, a) | B(_) = X; //~ ERROR variable `a` is not bound in all patterns - let A(a, b) | B(a) = X; //~ ERROR variable `b` is not bound in all patterns + let (A(a, _) | _) = X; //~ ERROR variable `a` is not bound in all patterns + let (_ | B(a)) = X; //~ ERROR variable `a` is not bound in all patterns + let (A(..) | B(a)) = X; //~ ERROR variable `a` is not bound in all patterns + let (A(a, _) | B(_)) = X; //~ ERROR variable `a` is not bound in all patterns + let (A(_, a) | B(_)) = X; //~ ERROR variable `a` is not bound in all patterns + let (A(a, b) | B(a)) = X; //~ ERROR variable `b` is not bound in all patterns // Two levels: const Y: E<E<u8>> = B(B(0)); - let A(A(..) | B(_), _) | B(a) = Y; //~ ERROR variable `a` is not bound in all patterns - let A(A(..) | B(a), _) | B(A(a, _) | B(a)) = Y; + let (A(A(..) | B(_), _) | B(a)) = Y; //~ ERROR variable `a` is not bound in all patterns + let (A(A(..) | B(a), _) | B(A(a, _) | B(a))) = Y; //~^ ERROR variable `a` is not bound in all patterns - let A(A(a, b) | B(c), d) | B(e) = Y; + let (A(A(a, b) | B(c), d) | B(e)) = Y; //~^ ERROR variable `a` is not bound in all patterns //~| ERROR variable `a` is not bound in all patterns //~| ERROR variable `b` is not bound in all patterns |
