Skip to content

Commit 30f575c

Browse files
committed
Incorporate suggestions made during review
1 parent 74958a3 commit 30f575c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

text/3366-diagnostic-attribute-namespace.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,8 @@ into the following negative trait impl:
180180
impl !IntoIterator for String {}
181181
```
182182

183-
This would simplify the syntax of the proposed attribute, but in turn block the implementation of type based filtering on the stabilization of `negative_impls`. On the other hand it would likely simplify writing more complex filters, that match only a certain generic set of types and it would prevent "duplicating" the filter-logic as this reuses the exiting trait system. The large disadvantage of this approach is that it couples error messages to the crates public API. Removing a negative trait impl is a breaking change, removing a `#[on_unimplemented]` attribute is only a change in the emitted compiler error.
183+
This would simplify the syntax of the proposed attribute, but in turn block the implementation of type based filtering on the stabilization of `negative_impls`. On the other hand it would likely simplify writing more complex filters, that match only a certain generic set of types and it would prevent "duplicating" the filter-logic as this reuses the exiting trait system. To express complex filtering logic this would likely need some sort of `specialization` for at least negative trait implementations. A second disadvantage of this approach is that it couples error messages to the crates public API. Removing a negative trait impl is a breaking change, removing a `#[on_unimplemented]` attribute is only a change in the emitted compiler error.
184184

185-
* Allow `#[diagnostic::on_unimplemented]` to be placed on types instead of traits. This would allow third party crates to customize the error messages emitted for unsatisfied trait bounds with out of crate traits. This feels more like an extension to the proposed attribute.
186185

187186
# Prior art
188187
[prior-art]: #prior-art
@@ -216,7 +215,9 @@ Clarify the procedure of various potential changes prior stabilisation of the at
216215
[future-possibilities]: #future-possibilities
217216

218217
* More attributes like `#[diagnostics::on_type_error]`
219-
* Extend the `#[diagnostics::on_unimplemented]` attribute to incorporate the semantics of `#[do_not_recommend]`
218+
* Extend the `#[diagnostics::on_unimplemented]` attribute to incorporate the semantics of `#[do_not_recommend]` or
219+
provide a distinct `#[diagnostics::do_not_recommend]` attribute
220220
* Un-RFC `#[do_not_recommend]`?
221221
* Apply `#[diagnostics::on_unimplemented]` to types as well
222222
* Extend the `if()` filter syntax to allow more complex filter expressions
223+
* Allow `#[diagnostic::on_unimplemented]` to be placed on types instead of traits. This would allow third party crates to customize the error messages emitted for unsatisfied trait bounds with out of crate traits.

0 commit comments

Comments
 (0)