Skip to content

Confusing error message when placing #![test] on a module #14772

@ghost

Description

//foo.rs
mod test;

//test.rs
#![test]

This will give a

error: functions used as tests must have signature fn() -> ().
foo.rs: mod test;
        ^~~~~~~~~

Which is particularly confusing when the user has already written some test functions in test.rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions