|
| 1 | +error: unexpected parentheses surrounding `match` arm pattern |
| 2 | + --> $DIR/feature-gate-guard-patterns.rs:10:9 |
| 3 | + | |
| 4 | +LL | (0 if guard(0)) => {}, |
| 5 | + | ^ ^ |
| 6 | + | |
| 7 | +help: remove parentheses surrounding the pattern |
| 8 | + | |
| 9 | +LL - (0 if guard(0)) => {}, |
| 10 | +LL + 0 if guard(0) => {}, |
| 11 | + | |
| 12 | + |
| 13 | +error[E0425]: cannot find value `x` in this scope |
| 14 | + --> $DIR/feature-gate-guard-patterns.rs:21:22 |
| 15 | + | |
| 16 | +LL | let ((x if guard(x)) | x) = 0; |
| 17 | + | ^ not found in this scope |
| 18 | + |
| 19 | +error[E0425]: cannot find value `x` in this scope |
| 20 | + --> $DIR/feature-gate-guard-patterns.rs:38:45 |
| 21 | + | |
| 22 | +LL | fn even_as_function_parameters(((x if guard(x), _) | (_, x)): (i32, i32)) {} |
| 23 | + | ^ |
| 24 | + | |
| 25 | +help: the binding `x` is available in a different scope in the same function |
| 26 | + --> $DIR/feature-gate-guard-patterns.rs:21:11 |
| 27 | + | |
| 28 | +LL | let ((x if guard(x)) | x) = 0; |
| 29 | + | ^ |
| 30 | + |
| 31 | +error[E0658]: guard patterns are experimental |
| 32 | + --> $DIR/feature-gate-guard-patterns.rs:16:15 |
| 33 | + | |
| 34 | +LL | (0 if guard(0)) | 1 => {}, |
| 35 | + | ^^^^^^^^ |
| 36 | + | |
| 37 | + = note: see issue #129967 <https://github.com/rust-lang/rust/issues/129967> for more information |
| 38 | + = help: add `#![feature(guard_patterns)]` to the crate attributes to enable |
| 39 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 40 | + = help: consider using match arm guards |
| 41 | + |
| 42 | +error[E0658]: guard patterns are experimental |
| 43 | + --> $DIR/feature-gate-guard-patterns.rs:21:16 |
| 44 | + | |
| 45 | +LL | let ((x if guard(x)) | x) = 0; |
| 46 | + | ^^^^^^^^ |
| 47 | + | |
| 48 | + = note: see issue #129967 <https://github.com/rust-lang/rust/issues/129967> for more information |
| 49 | + = help: add `#![feature(guard_patterns)]` to the crate attributes to enable |
| 50 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 51 | + = help: consider using match arm guards |
| 52 | + |
| 53 | +error[E0658]: guard patterns are experimental |
| 54 | + --> $DIR/feature-gate-guard-patterns.rs:25:18 |
| 55 | + | |
| 56 | +LL | if let (x if guard(x)) = 0 {} |
| 57 | + | ^^^^^^^^ |
| 58 | + | |
| 59 | + = note: see issue #129967 <https://github.com/rust-lang/rust/issues/129967> for more information |
| 60 | + = help: add `#![feature(guard_patterns)]` to the crate attributes to enable |
| 61 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 62 | + = help: consider using match arm guards |
| 63 | + |
| 64 | +error[E0658]: guard patterns are experimental |
| 65 | + --> $DIR/feature-gate-guard-patterns.rs:29:21 |
| 66 | + | |
| 67 | +LL | while let (x if guard(x)) = 0 {} |
| 68 | + | ^^^^^^^^ |
| 69 | + | |
| 70 | + = note: see issue #129967 <https://github.com/rust-lang/rust/issues/129967> for more information |
| 71 | + = help: add `#![feature(guard_patterns)]` to the crate attributes to enable |
| 72 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 73 | + = help: consider using match arm guards |
| 74 | + |
| 75 | +error[E0658]: guard patterns are experimental |
| 76 | + --> $DIR/feature-gate-guard-patterns.rs:34:21 |
| 77 | + | |
| 78 | +LL | while let (x if guard(x)) = 0 {} |
| 79 | + | ^^^^^^^^ |
| 80 | + | |
| 81 | + = note: see issue #129967 <https://github.com/rust-lang/rust/issues/129967> for more information |
| 82 | + = help: add `#![feature(guard_patterns)]` to the crate attributes to enable |
| 83 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 84 | + = help: consider using match arm guards |
| 85 | + |
| 86 | +error[E0658]: guard patterns are experimental |
| 87 | + --> $DIR/feature-gate-guard-patterns.rs:38:39 |
| 88 | + | |
| 89 | +LL | fn even_as_function_parameters(((x if guard(x), _) | (_, x)): (i32, i32)) {} |
| 90 | + | ^^^^^^^^ |
| 91 | + | |
| 92 | + = note: see issue #129967 <https://github.com/rust-lang/rust/issues/129967> for more information |
| 93 | + = help: add `#![feature(guard_patterns)]` to the crate attributes to enable |
| 94 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 95 | + = help: consider using match arm guards |
| 96 | + |
| 97 | +warning: irrefutable `if let` pattern |
| 98 | + --> $DIR/feature-gate-guard-patterns.rs:25:8 |
| 99 | + | |
| 100 | +LL | if let (x if guard(x)) = 0 {} |
| 101 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 102 | + | |
| 103 | + = note: this pattern will always match, so the `if let` is useless |
| 104 | + = help: consider replacing the `if let` with a `let` |
| 105 | + = note: `#[warn(irrefutable_let_patterns)]` on by default |
| 106 | + |
| 107 | +warning: irrefutable `while let` pattern |
| 108 | + --> $DIR/feature-gate-guard-patterns.rs:29:11 |
| 109 | + | |
| 110 | +LL | while let (x if guard(x)) = 0 {} |
| 111 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 112 | + | |
| 113 | + = note: this pattern will always match, so the loop will never exit |
| 114 | + = help: consider instead using a `loop { ... }` with a `let` inside it |
| 115 | + |
| 116 | +error: aborting due to 9 previous errors; 2 warnings emitted |
| 117 | + |
| 118 | +Some errors have detailed explanations: E0425, E0658. |
| 119 | +For more information about an error, try `rustc --explain E0425`. |
0 commit comments