-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)Area: Source-based code coverage (-Cinstrument-coverage)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamregression-untriagedUntriaged performance or correctness regression.Untriaged performance or correctness regression.
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?
link2xt
Metadata
Metadata
Assignees
Labels
A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)Area: Source-based code coverage (-Cinstrument-coverage)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamregression-untriagedUntriaged performance or correctness regression.Untriaged performance or correctness regression.