Skip to content

error message for missing main function in example is non-specific #1361

Closed
@huonw

Description

@huonw
$ cargo new missing-main
$ cd missing-main
$ mkdir examples
$ touch examples/foo.rs
$ cargo build
   Compiling missing-main v0.0.1 (file:///home/huon/tmp/missing-main)
error: main function not found
error: aborting due to previous error
Could not compile `missing-main`.

Running with --verbose does at least print the last command run (pointing the finger at examples/foo,rs), but it seems bad to have a raw error: printed like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions