Skip to content

Commit 3818f8b

Browse files
committed
Add regression test for #58886
1 parent f156d92 commit 3818f8b

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mod unclosed_delim_mod;
2+
3+
fn main() {
4+
let _: usize = unclosed_delim_mod::new();
5+
//~^ ERROR mismatched types
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error: incorrect close delimiter: `}`
2+
--> $DIR/unclosed_delim_mod.rs:5:1
3+
|
4+
LL | pub fn new() -> Result<Value, ()> {
5+
| - close delimiter possibly meant for this
6+
LL | Ok(Value {
7+
| - un-closed delimiter
8+
LL | }
9+
LL | }
10+
| ^ incorrect close delimiter
11+
12+
error[E0308]: mismatched types
13+
--> $DIR/unclosed-delimiter-in-dep.rs:4:20
14+
|
15+
LL | let _: usize = unclosed_delim_mod::new();
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected usize, found enum `std::result::Result`
17+
|
18+
= note: expected type `usize`
19+
found type `std::result::Result<unclosed_delim_mod::Value, ()>`
20+
21+
error: aborting due to 2 previous errors
22+
23+
For more information about this error, try `rustc --explain E0308`.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pub struct Value {}
2+
pub fn new() -> Result<Value, ()> {
3+
Ok(Value {
4+
}
5+
}
6+
//~^ ERROR incorrect close delimiter
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error: incorrect close delimiter: `}`
2+
--> $DIR/unclosed_delim_mod.rs:5:1
3+
|
4+
LL | pub fn new() -> Result<Value, ()> {
5+
| - close delimiter possibly meant for this
6+
LL | Ok(Value {
7+
| - un-closed delimiter
8+
LL | }
9+
LL | }
10+
| ^ incorrect close delimiter
11+
12+
error[E0601]: `main` function not found in crate `unclosed_delim_mod`
13+
|
14+
= note: consider adding a `main` function to `$DIR/unclosed_delim_mod.rs`
15+
16+
error: aborting due to 2 previous errors
17+
18+
For more information about this error, try `rustc --explain E0601`.

0 commit comments

Comments
 (0)