summaryrefslogtreecommitdiffstats
path: root/src/test/ui/or-patterns/or-patterns-syntactic-pass.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/or-patterns/or-patterns-syntactic-pass.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/or-patterns/or-patterns-syntactic-pass.rs')
-rw-r--r--src/test/ui/or-patterns/or-patterns-syntactic-pass.rs78
1 files changed, 0 insertions, 78 deletions
diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-pass.rs b/src/test/ui/or-patterns/or-patterns-syntactic-pass.rs
deleted file mode 100644
index 92750bec8..000000000
--- a/src/test/ui/or-patterns/or-patterns-syntactic-pass.rs
+++ /dev/null
@@ -1,78 +0,0 @@
-// Here we test all the places `|` is *syntactically* allowed.
-// This is not a semantic test. We only test parsing.
-
-// check-pass
-
-fn main() {}
-
-// Test the `pat` macro fragment parser:
-macro_rules! accept_pat {
- ($p:pat) => {};
-}
-
-accept_pat!((p | q));
-accept_pat!((p | q,));
-accept_pat!(TS(p | q));
-accept_pat!(NS { f: p | q });
-accept_pat!([p | q]);
-
-// Non-macro tests:
-
-#[cfg(FALSE)]
-fn or_patterns() {
- // Top level of `let`:
- let (| A | B);
- let (A | B);
- let (A | B): u8;
- let (A | B) = 0;
- let (A | B): u8 = 0;
-
- // Top level of `for`:
- for | A | B in 0 {}
- for A | B in 0 {}
-
- // Top level of `while`:
- while let | A | B = 0 {}
- while let A | B = 0 {}
-
- // Top level of `if`:
- if let | A | B = 0 {}
- if let A | B = 0 {}
-
- // Top level of `match` arms:
- match 0 {
- | A | B => {}
- A | B => {}
- }
-
- // Functions:
- fn fun((A | B): _) {}
-
- // Lambdas:
- let _ = |(A | B): u8| ();
-
- // Parenthesis and tuple patterns:
- let (A | B);
- let (A | B,);
-
- // Tuple struct patterns:
- let A(B | C);
- let E::V(B | C);
-
- // Struct patterns:
- let S { f1: B | C, f2 };
- let E::V { f1: B | C, f2 };
-
- // Slice patterns:
- let [A | B, .. | ..];
-
- // These bind as `(prefix p) | q` as opposed to `prefix (p | q)`:
- let (box 0 | 1); // Unstable; we *can* change the precedence if we want.
- //~^ WARN box pattern syntax is experimental
- //~| WARN unstable syntax
- let (&0 | 1);
- let (&mut 0 | 1);
- let (x @ 0 | 1);
- let (ref x @ 0 | 1);
- let (ref mut x @ 0 | 1);
-}