Skip to content

Commit

Permalink
Slightly change to wording around the definition of the #[diagnostic]
Browse files Browse the repository at this point in the history
namespace

This hopefully addresses both concerns raised by petrochenkov:

> Does #[diagnostic::something] behave like #[rustfmt::skip] from name
resolution / macro expansion point of view?

By specifying that `#[diagnostic]` is a built-in tool attribute

> How many of these attributes will exist - 2, 3, 5?
> Why is it necessary to add a mechanism for grouping them instead of just
using built-in attributes?

By being explicit about that this namespace also serves an
organizational need by defining a common set of rules. This hopefully
allows the language team to delegate the decisions about the design of
specific attributes to other teams.
  • Loading branch information
weiznich committed May 9, 2023
1 parent 4b112aa commit 0d519ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion text/3366-diagnostic-attribute-namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ I expect the new attributes to be documented on the existing [Diagnostics](https

## The `#[diagnostic]` attribute namespace

This RFC proposes to introduce a new `#[diagnostic]` attribute namespace. This namespace is supposed to contain different attributes, which allow users to hint the compiler to emit specific diagnostic messages in certain cases like type mismatches, unsatisfied trait bounds or similar situations. By collecting such attributes in a common namespace it is easier for users to find useful attributes and it is easier for the language team to establish a set of common rules for these attributes.
This RFC proposes to introduce a new built-in `#[diagnostic]` tool attribute namespace. This namespace is supposed to contain different attributes, which allow users to hint the compiler to emit specific diagnostic messages in certain cases like type mismatches, unsatisfied trait bounds or similar situations. By collecting such attributes in a common namespace it is easier for users to find useful attributes and it is easier for the language team to establish a set of common rules for these attributes. This opens the possibility to delegate the design of specific attributes to other teams later on.

Attributes in this namespace are generally expected to be formed like:
```rust
Expand Down

0 comments on commit 0d519ab

Please sign in to comment.