Open
Description
Code
I have an internal macro for domain-specific coverage tracking:
macro_rules! coverage {
() => {
/* .. */
};
}
pub(crate) use coverage;
On version 1.73.0, this compiles without error (godbolt).
On version 1.74.0 and above, this results in an error (godbolt):
error[E0659]: `coverage` is ambiguous
--> <source>:7:16
|
7 | pub(crate) use coverage;
| ^^^^^^^^ ambiguous name
|
= note: ambiguous because of a name conflict with a builtin attribute
= note: `coverage` could refer to a built-in attribute
My understanding is that this is an acceptable breakage in general. (Though, perhaps should be in the 1.74.0 compatibility notes).
However, what might make this unacceptable is that this attribute is not actually stable:
#[coverage(off)]
pub fn foo() {}
gives (godbolt):
error[E0658]: the `#[coverage]` attribute is an experimental feature
--> <source>:1:1
|
1 | #[coverage(off)]
| ^^^^^^^^^^^^^^^^
|
= note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information
= help: add `#![feature(coverage_attribute)]` to the crate
Is it expected that an inactive experimental attribute can cause name ambiguity on stable Rust?
Metadata
Metadata
Assignees
Labels
Area: Source-based code coverage (-Cinstrument-coverage)Area: Name/path resolution done by `rustc_resolve` specificallyCategory: This is a bug.Medium priorityStatus: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team, which will review and decide on the PR/issue.Untriaged performance or correctness regression.