Skip to content

compile_error macro does not emit diagnostic on top level #8459

@Veykril

Description

@Veykril
compile_error!("top level"); // < doesn't emit anything
fn main() {
    compile_error!("non top level");
    // ^^^^ emits `non top level` diagnostic
}
const _: () = compile_error!("non top level"); // < doesn't emit anything

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingA-macromacro expansionS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions