]> git.lizzy.rs Git - rust.git/blob - src/test/ui/main-wrong-location.stderr
Provide a span if main function is not present in crate
[rust.git] / src / test / ui / main-wrong-location.stderr
1 error[E0601]: `main` function not found in crate `main_wrong_location`
2   --> $DIR/main-wrong-location.rs:1:1
3    |
4 LL | / mod m {
5 LL | |
6 LL | |     // An inferred main entry point (that doesn't use #[main])
7 LL | |     // must appear at the top of the crate
8 LL | |     fn main() { }
9 LL | | }
10    | |_^ the main function must be defined at the crate level (in `$DIR/main-wrong-location.rs`)
11    |
12 note: here is a function named `main`
13   --> $DIR/main-wrong-location.rs:5:5
14    |
15 LL |     fn main() { }
16    |     ^^^^^^^^^^^^^
17    = note: you have one or more functions named `main` not defined at the crate level
18    = help: either move the `main` function definitions or attach the `#[main]` attribute to one of them
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0601`.