]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/parser/issue-2354.stderr
Provide a span if main function is not present in crate
[rust.git] / src / test / ui / parser / issue-2354.stderr
index a41696884a3722db30b0c5ae2b9dd904997cd51f..038e3dcfa40a90c4f53e5b005450e85491cf2336 100644 (file)
@@ -1,16 +1,38 @@
 error: this file contains an un-closed delimiter
-  --> $DIR/issue-2354.rs:16:66
+  --> $DIR/issue-2354.rs:18:66
    |
-LL | fn foo() { //~ NOTE un-closed delimiter
+LL | fn foo() {
    |          - un-closed delimiter
-LL |   match Some(x) {
-   |                 - this delimiter might not be properly closed...
+...
+LL |   match Some(10) {
+   |                  - this delimiter might not be properly closed...
 ...
 LL | }
    | - ...as it matches this but it has different indentation
 ...
-LL | fn main() {} //~ ERROR this file contains an un-closed delimiter
+LL |
    |                                                                  ^
 
-error: aborting due to previous error
+error[E0601]: `main` function not found in crate `issue_2354`
+  --> $DIR/issue-2354.rs:1:1
+   |
+LL | / fn foo() {
+LL | |
+LL | |
+LL | |
+...  |
+LL | | fn main() {}
+LL | |
+   | |_________________________________________________________________^ the main function must be defined at the crate level (in `$DIR/issue-2354.rs`)
+   |
+note: here is a function named `main`
+  --> $DIR/issue-2354.rs:17:1
+   |
+LL | fn main() {}
+   | ^^^^^^^^^^^^
+   = note: you have one or more functions named `main` not defined at the crate level
+   = help: either move the `main` function definitions or attach the `#[main]` attribute to one of them
+
+error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0601`.