Skip to content

Commit 053a696

Browse files
committed
Writing tests
1 parent b85d588 commit 053a696

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pub enum ErrorHandled {
2+
Reported,
3+
TooGeneric,
4+
}
5+
6+
impl ErrorHandled {
7+
pub fn assert_reported(self) {
8+
match self {
9+
ErrorHandled::Reported => {}
10+
ErrorHandled::TooGeneric => panic!(),
11+
}
12+
}
13+
}
14+
15+
fn struct_generic(x: Vec<i32>) {
16+
for v in x {
17+
println!("{}", v);
18+
}
19+
}
20+
} //~ ERROR unexpected closing delimiter: `}`
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: unexpected closing delimiter: `}`
2+
--> $DIR/issue-70583-block-is-empty-1.rs:20:1
3+
|
4+
LL | }
5+
| ^ unexpected closing delimiter
6+
7+
error: aborting due to previous error
8+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pub enum ErrorHandled {
2+
Reported,
3+
TooGeneric,
4+
}
5+
6+
impl ErrorHandled {
7+
pub fn assert_reported(self) {
8+
match self {
9+
ErrorHandled::Reported => {}}
10+
//^~ ERROR this block is empty, you might have not mean to close it
11+
ErrorHandled::TooGeneric => panic!(),
12+
}
13+
}
14+
} //~ ERROR unexpected closing delimiter: `}`
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: unexpected closing delimiter: `}`
2+
--> $DIR/issue-70583-block-is-empty-2.rs:14:1
3+
|
4+
LL | ErrorHandled::Reported => {}}
5+
| -- this block is empty, you might have not meant to close it
6+
...
7+
LL | }
8+
| ^ unexpected closing delimiter
9+
10+
error: aborting due to previous error
11+

0 commit comments

Comments
 (0)