Skip to content

cargo test doesn't mention which file(s) in examples/ is affected when the main function is missing #4948

Closed
@Cobrand

Description

@Cobrand

Basically, if you have a lib crate with multiple files in "examples", but one of them doesn't have a main, you get this error when running cargo test:

error[E0601]: main function not found

But you don't know which file is affected by this error.

It would be better to have an error message that says "main function not found in examples/something.rs".

Note that it may be related to rustc itself, but just in case I opened an issue here as it seemed more fit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions