rust icon indicating copy to clipboard operation
rust copied to clipboard

Wrong diagnostic: `main` function not found in crate

Open oriongonza opened this issue 1 year ago • 4 comments

Tested on nightly and stable.

;
fn main() { }
error: expected item, found `;`
 --> src/main.rs:1:1
  |
1 | ;
  | ^ help: remove this semicolon

error[E0601]: `main` function not found in crate `tests`
 --> src/main.rs:1:2
  |
1 | ;
  |  ^ consider adding a `main` function to `src/main.rs`

For more information about this error, try `rustc --explain E0601`.
error: could not compile `tests` (bin "tests") due to 2 previous errors

The second diagnostic is strange.

oriongonza avatar May 09 '24 17:05 oriongonza

@rustbot label +A-diagnostics S-has-mvce

oriongonza avatar May 09 '24 17:05 oriongonza

@rustbot claim

gurry avatar May 11 '24 03:05 gurry

@saethlin any idea why rustbot ignored me?

oriongonza avatar May 12 '24 21:05 oriongonza

Just guessing, the missing + for S-has-mcve maybe?

saethlin avatar May 12 '24 22:05 saethlin

Oops, this should'nt've been closed.

fmease avatar May 19 '24 13:05 fmease