Skip to content

Confusing documentation for compile_error!() #63375

Closed
@SOF3

Description

@SOF3

Referring to

rust/src/libcore/macros.rs

Lines 681 to 683 in db7c773

/// This macro should be used when a crate uses a conditional compilation strategy to provide
/// better error messages for erroneous conditions. It's the compiler-level form of [`panic!`],
/// which emits an error at *runtime*, rather than during compilation.

It's the compiler-level form of panic!, which emits an error at runtime, rather than during compilation.

It is unclear whether the "which" refers to "panic!" or "the compiler-level form of panic!". It is more clear to write:

It is the compiler-level form of panic!, but emits an error during compilation, rather than at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions