Skip to content

#[doc = compile_error!()] no longer emits a clean error #153930

Description

@kotauskas

The following code used to only emit one error (the message passed to compile_error!()) on Rust 1.93, but on Rust 1.94, it emits both the given message and an unhelpful "attribute value must be a literal".

#[doc = compile_error!("my error message")]
fn g() {}

Godbolt link.

I use this in doctest-file to produce errors in a macro meant to be used in #[doc = …] position.

@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions