rust/tests/ui/parser/recover/recover-pat-exprs.stderr

773 lines
24 KiB
Plaintext
Raw Normal View History

2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:5:9
|
LL | x.y => (),
| ^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x.y => (),
| ~~~ +++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.y;
LL ~ match 0 {
LL | x => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.y } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:6:9
|
LL | x.0 => (),
| ^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x.0 => (),
| ~~~ +++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.0;
LL ~ match 0 {
LL | x => (),
LL | x.y => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.0 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:7:9
|
LL | x._0 => (),
| ^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x._0 => (),
| ~~~ ++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x._0;
LL ~ match 0 {
LL | x => (),
LL | x.y => (),
LL | x.0 => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x._0 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:8:9
|
LL | x.0.1 => (),
| ^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x.0.1 => (),
| ~~~ +++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.0.1;
LL ~ match 0 {
LL | x => (),
...
LL | x._0 => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.0.1 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:9:9
|
LL | x.4.y.17.__z => (),
| ^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x.4.y.17.__z => (),
| ~~~ ++++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.4.y.17.__z;
LL ~ match 0 {
LL | x => (),
...
LL | x.0.1 => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.4.y.17.__z } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
--> $DIR/recover-pat-exprs.rs:12:12
|
LL | { let x.0e0; }
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
--> $DIR/recover-pat-exprs.rs:13:12
|
LL | { let x.-0.0; }
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
--> $DIR/recover-pat-exprs.rs:14:12
|
LL | { let x.-0; }
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
--> $DIR/recover-pat-exprs.rs:16:12
|
LL | { let x.0u32; }
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
--> $DIR/recover-pat-exprs.rs:17:12
|
LL | { let x.0.0_f64; }
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:23:9
|
LL | x[0] => (),
| ^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x[0] => (),
| ~~~ ++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x[0];
LL ~ match 0 {
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x[0] } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:24:9
|
LL | x[..] => (),
| ^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x[..] => (),
| ~~~ +++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x[..];
LL ~ match 0 {
LL | x[0] => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x[..] } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
--> $DIR/recover-pat-exprs.rs:27:12
|
LL | { let x[0, 1, 2]; }
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
--> $DIR/recover-pat-exprs.rs:28:12
|
LL | { let x[0; 20]; }
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
--> $DIR/recover-pat-exprs.rs:29:12
|
LL | { let x[]; }
| ^ expected one of `:`, `;`, `=`, `@`, or `|`
error: expected one of `)`, `,`, `@`, or `|`, found `[`
--> $DIR/recover-pat-exprs.rs:30:13
|
LL | { let (x[]); }
| ^
| |
| expected one of `)`, `,`, `@`, or `|`
| help: missing `,`
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:37:9
|
LL | x.f() => (),
| ^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x.f() => (),
| ~~~ +++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.f();
LL ~ match 0 {
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.f() } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:38:9
|
LL | x._f() => (),
| ^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x._f() => (),
| ~~~ ++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x._f();
LL ~ match 0 {
LL | x.f() => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x._f() } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:39:9
|
LL | x? => (),
| ^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x? => (),
| ~~~ ++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x?;
LL ~ match 0 {
LL | x.f() => (),
LL | x._f() => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x? } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:40:9
|
LL | ().f() => (),
| ^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == ().f() => (),
| ~~~ ++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = ().f();
LL ~ match 0 {
LL | x.f() => (),
LL | x._f() => (),
LL | x? => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { ().f() } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:41:9
|
LL | (0, x)?.f() => (),
| ^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == (0, x)?.f() => (),
| ~~~ +++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = (0, x)?.f();
LL ~ match 0 {
LL | x.f() => (),
...
LL | ().f() => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { (0, x)?.f() } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:42:9
|
LL | x.f().g() => (),
| ^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x.f().g() => (),
| ~~~ +++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.f().g();
LL ~ match 0 {
LL | x.f() => (),
...
LL | (0, x)?.f() => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.f().g() } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:43:9
|
LL | 0.f()?.g()?? => (),
| ^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == 0.f()?.g()?? => (),
| ~~~ ++++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 0.f()?.g()??;
LL ~ match 0 {
LL | x.f() => (),
...
LL | x.f().g() => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { 0.f()?.g()?? } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:50:9
|
LL | x as usize => (),
| ^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x as usize => (),
| ~~~ ++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x as usize;
LL ~ match 0 {
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x as usize } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:51:9
|
LL | 0 as usize => (),
| ^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == 0 as usize => (),
| ~~~ ++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 0 as usize;
LL ~ match 0 {
LL | x as usize => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { 0 as usize } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:52:9
|
LL | x.f().0.4 as f32 => (),
| ^^^^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == x.f().0.4 as f32 => (),
| ~~~ ++++++++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.f().0.4 as f32;
LL ~ match 0 {
LL | x as usize => (),
LL | 0 as usize => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.f().0.4 as f32 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:59:9
|
LL | 1 + 1 => (),
| ^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == 1 + 1 => (),
| ~~~ +++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = 1 + 1;
LL ~ match 0 {
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { 1 + 1 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:60:9
|
LL | (1 + 2) * 3 => (),
| ^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == (1 + 2) * 3 => (),
| ~~~ +++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = (1 + 2) * 3;
LL ~ match 0 {
LL | 1 + 1 => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { (1 + 2) * 3 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:63:9
2024-07-04 07:10:17 -05:00
|
LL | x.0 > 2 => (),
| ^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == (x.0 > 2) => (),
| ~~~ +++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.0 > 2;
LL ~ match 0 {
LL | 1 + 1 => (),
...
LL |
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.0 > 2 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:64:9
2024-07-04 07:10:17 -05:00
|
LL | x.0 == 2 => (),
| ^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == (x.0 == 2) => (),
| ~~~ ++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = x.0 == 2;
LL ~ match 0 {
LL | 1 + 1 => (),
...
LL | x.0 > 2 => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { x.0 == 2 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:69:13
2024-07-04 07:10:17 -05:00
|
LL | (x, y.0 > 2) if x != 0 => (),
| ^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to the match arm guard
|
LL | (x, val) if x != 0 && val == (y.0 > 2) => (),
| ~~~ +++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = y.0 > 2;
LL ~ match (0, 0) {
LL ~ (x, VAL) if x != 0 => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | (x, const { y.0 > 2 }) if x != 0 => (),
| +++++++ +
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:70:13
|
LL | (x, y.0 > 2) if x != 0 || x != 1 => (),
| ^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to the match arm guard
|
LL | (x, val) if (x != 0 || x != 1) && val == (y.0 > 2) => (),
| ~~~ + +++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = y.0 > 2;
LL ~ match (0, 0) {
LL | (x, y.0 > 2) if x != 0 => (),
LL ~ (x, VAL) if x != 0 || x != 1 => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | (x, const { y.0 > 2 }) if x != 0 || x != 1 => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: left-hand side of `@` must be a binding
--> $DIR/recover-pat-exprs.rs:83:9
2024-07-04 07:10:17 -05:00
|
LL | x.sqrt() @ .. => (),
| --------^^^--
| | |
| | also a pattern
| interpreted as a pattern, not a binding
|
= note: bindings are `x`, `mut x`, `ref x`, and `ref mut x`
error: expected one of `)`, `,`, or `|`, found `+`
--> $DIR/recover-pat-exprs.rs:97:12
|
LL | (_ + 1) => (),
| ^ expected one of `)`, `,`, or `|`
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:81:9
|
LL | u8::MAX.abs() => (),
| ^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == u8::MAX.abs() => (),
| ~~~ +++++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = u8::MAX.abs();
LL ~ match u8::MAX {
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { u8::MAX.abs() } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:86:17
2024-07-04 07:10:17 -05:00
|
LL | z @ w @ v.u() => (),
| ^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | z @ w @ val if val == v.u() => (),
| ~~~ +++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = v.u();
LL ~ match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL |
LL ~ z @ w @ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | z @ w @ const { v.u() } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:88:9
2024-07-04 07:10:17 -05:00
|
LL | y.ilog(3) => (),
| ^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == y.ilog(3) => (),
| ~~~ +++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = y.ilog(3);
LL ~ match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL |
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { y.ilog(3) } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:90:9
2024-07-04 07:10:17 -05:00
|
LL | n + 1 => (),
| ^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == n + 1 => (),
| ~~~ +++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = n + 1;
LL ~ match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL |
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { n + 1 } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:92:10
2024-07-04 07:10:17 -05:00
|
LL | ("".f() + 14 * 8) => (),
| ^^^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | (val) if val == "".f() + 14 * 8 => (),
| ~~~ +++++++++++++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = "".f() + 14 * 8;
LL ~ match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL |
LL ~ (VAL) => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | (const { "".f() + 14 * 8 }) => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:95:9
2024-07-04 07:10:17 -05:00
|
LL | f?() => (),
| ^^^^ arbitrary expressions are not allowed in patterns
|
help: consider moving the expression to a match arm guard
|
LL | val if val == f?() => (),
| ~~~ ++++++++++++++
help: consider extracting the expression into a `const`
|
LL + const VAL: /* Type */ = f?();
LL ~ match u8::MAX {
LL | u8::MAX.abs() => (),
...
LL | 0 | ((1) | 2) | 3 => (),
LL ~ VAL => (),
|
help: consider wrapping the expression in an inline `const` (requires `#![feature(inline_const_pat)]`)
|
LL | const { f?() } => (),
| +++++++ +
2024-07-04 07:10:17 -05:00
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:101:9
2024-07-04 07:10:17 -05:00
|
LL | let 1 + 1 = 2;
| ^^^^^ arbitrary expressions are not allowed in patterns
error: expected one of `)`, `,`, `@`, or `|`, found `*`
--> $DIR/recover-pat-exprs.rs:104:28
2024-07-04 07:10:17 -05:00
|
LL | let b = matches!(x, (x * x | x.f()) | x[0]);
| ^ expected one of `)`, `,`, `@`, or `|`
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
= note: while parsing argument for this `pat` macro fragment
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:60:10
|
LL | (1 + 2) * 3 => (),
| ^^^^^ arbitrary expressions are not allowed in patterns
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:75:5
|
LL | 1 + 2 * PI.cos() => 2,
| ^^^^^^^^^^^^^^^^ arbitrary expressions are not allowed in patterns
error: expected a pattern, found an expression
--> $DIR/recover-pat-exprs.rs:83:9
|
LL | x.sqrt() @ .. => (),
| ^^^^^^^^ arbitrary expressions are not allowed in patterns
error: aborting due to 45 previous errors
2024-07-04 07:10:17 -05:00