Skip to content

Support for fatal compile_error that suppresses subsequent errors #68838

@joshtriplett

Description

@joshtriplett

If a crate includes something like:

#[cfg(not(target_os = "linux"))]
compile_error!("This crate only runs on Linux")

then it isn't helpful for rustc to report that error but then go on to emit many more cascading errors about failed use statements and types that don't exist and similar.

It's especially unhelpful when those additional errors scroll the initial error off the screen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions