Skip to content

Commit 860fc24

Browse files
committed
Remove extra errors
1 parent b1ddd57 commit 860fc24

File tree

2 files changed

+6
-39
lines changed

2 files changed

+6
-39
lines changed

tests/ui/suggestions/issue-114701.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
enum Enum<T> { , SVariant { v: T }, UVariant } //~ ERROR expected identifier, found `,`
1+
enum Enum<T> { SVariant { v: T }, UVariant }
22

33
macro_rules! is_variant {
44
(TSVariant, ) => (!);
55
(SVariant, ) => (!);
66
(UVariant, $expr:expr) => (is_variant!(@check UVariant, {}, $expr));
77
(@check $variant:ident, $matcher:tt, $expr:expr) => (
8-
assert!(if let Enum::$variant::<()> $matcher = $expr () else { false }, //~ ERROR this `if` expression
8+
assert!(if let Enum::$variant::<()> $matcher = $expr () { true } else { false },
99
);
1010
);
1111
}
+4-37
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,15 @@
1-
error: expected identifier, found `,`
2-
--> $DIR/issue-114701.rs:1:16
3-
|
4-
LL | enum Enum<T> { , SVariant { v: T }, UVariant }
5-
| ^
6-
| |
7-
| expected identifier
8-
| help: remove this comma
9-
10-
error: this `if` expression is missing a block after the condition
11-
--> $DIR/issue-114701.rs:8:17
12-
|
13-
LL | assert!(if let Enum::$variant::<()> $matcher = $expr () else { false },
14-
| ^^
15-
...
16-
LL | is_variant!(UVariant, Enum::<()>::UVariant);
17-
| ------------------------------------------- in this macro invocation
18-
|
19-
help: add a block here
20-
--> $DIR/issue-114701.rs:8:64
21-
|
22-
LL | assert!(if let Enum::$variant::<()> $matcher = $expr () else { false },
23-
| ^
24-
...
25-
LL | is_variant!(UVariant, Enum::<()>::UVariant);
26-
| ------------------------------------------- in this macro invocation
27-
= note: this error originates in the macro `is_variant` (in Nightly builds, run with -Z macro-backtrace for more info)
28-
help: remove the `if` if you meant to write a `let...else` statement
29-
|
30-
LL - assert!(if let Enum::$variant::<()> $matcher = $expr () else { false },
31-
LL + assert!(let Enum::$variant::<()> $matcher = $expr () else { false },
32-
|
33-
341
error[E0618]: expected function, found `Enum<()>`
352
--> $DIR/issue-114701.rs:14:27
363
|
37-
LL | enum Enum<T> { , SVariant { v: T }, UVariant }
38-
| -------- `Enum::UVariant` defined here
4+
LL | enum Enum<T> { SVariant { v: T }, UVariant }
5+
| -------- `Enum::UVariant` defined here
396
...
40-
LL | assert!(if let Enum::$variant::<()> $matcher = $expr () else { false },
7+
LL | assert!(if let Enum::$variant::<()> $matcher = $expr () { true } else { false },
418
| -------- call expression requires function
429
...
4310
LL | is_variant!(UVariant, Enum::<()>::UVariant);
4411
| ^^^^^^^^^^^^^^^^^^^^
4512

46-
error: aborting due to 3 previous errors
13+
error: aborting due to previous error
4714

4815
For more information about this error, try `rustc --explain E0618`.

0 commit comments

Comments
 (0)