Add regression test for #58886
This commit is contained in:
parent
f156d92207
commit
3818f8ba34
4 changed files with 53 additions and 0 deletions
6
src/test/ui/parser/unclosed-delimiter-in-dep.rs
Normal file
6
src/test/ui/parser/unclosed-delimiter-in-dep.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
mod unclosed_delim_mod;
|
||||
|
||||
fn main() {
|
||||
let _: usize = unclosed_delim_mod::new();
|
||||
//~^ ERROR mismatched types
|
||||
}
|
23
src/test/ui/parser/unclosed-delimiter-in-dep.stderr
Normal file
23
src/test/ui/parser/unclosed-delimiter-in-dep.stderr
Normal file
|
@ -0,0 +1,23 @@
|
|||
error: incorrect close delimiter: `}`
|
||||
--> $DIR/unclosed_delim_mod.rs:5:1
|
||||
|
|
||||
LL | pub fn new() -> Result<Value, ()> {
|
||||
| - close delimiter possibly meant for this
|
||||
LL | Ok(Value {
|
||||
| - un-closed delimiter
|
||||
LL | }
|
||||
LL | }
|
||||
| ^ incorrect close delimiter
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/unclosed-delimiter-in-dep.rs:4:20
|
||||
|
|
||||
LL | let _: usize = unclosed_delim_mod::new();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected usize, found enum `std::result::Result`
|
||||
|
|
||||
= note: expected type `usize`
|
||||
found type `std::result::Result<unclosed_delim_mod::Value, ()>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
6
src/test/ui/parser/unclosed_delim_mod.rs
Normal file
6
src/test/ui/parser/unclosed_delim_mod.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
pub struct Value {}
|
||||
pub fn new() -> Result<Value, ()> {
|
||||
Ok(Value {
|
||||
}
|
||||
}
|
||||
//~^ ERROR incorrect close delimiter
|
18
src/test/ui/parser/unclosed_delim_mod.stderr
Normal file
18
src/test/ui/parser/unclosed_delim_mod.stderr
Normal file
|
@ -0,0 +1,18 @@
|
|||
error: incorrect close delimiter: `}`
|
||||
--> $DIR/unclosed_delim_mod.rs:5:1
|
||||
|
|
||||
LL | pub fn new() -> Result<Value, ()> {
|
||||
| - close delimiter possibly meant for this
|
||||
LL | Ok(Value {
|
||||
| - un-closed delimiter
|
||||
LL | }
|
||||
LL | }
|
||||
| ^ incorrect close delimiter
|
||||
|
||||
error[E0601]: `main` function not found in crate `unclosed_delim_mod`
|
||||
|
|
||||
= note: consider adding a `main` function to `$DIR/unclosed_delim_mod.rs`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0601`.
|
Loading…
Reference in a new issue