The feature gate for the issue is #![feature(diagnotic_on_type_err)].
Description of the feature
Similar to other diagnostic attribute, the goal of diagnostic::on_type_error is to allow crate authors to attach custom notes to type errors involving their types, improving diagnostics for common patterns such as wrapper types where users forget to access the inner value or different inner type or outer value.
As agreed upon, see #155200 (comment), the semantic will only be:
- only note is supported (not message or label)
- the annotated ADT must have exactly one generic type parameter
- More advanced features such as filtering based on types or generics will supported in the future
Minimally for now, we will be supporting:
#[diagnostic::on_type_error(
note = "text",
)]
struct S<T>(T);
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
Implementation history
#155200
The feature gate for the issue is
#![feature(diagnotic_on_type_err)].Description of the feature
Similar to other
diagnosticattribute, the goal ofdiagnostic::on_type_erroris to allow crate authors to attach custom notes to type errors involving their types, improving diagnostics for common patterns such as wrapper types where users forget to access the inner value or different inner type or outer value.As agreed upon, see #155200 (comment), the semantic will only be:
Minimally for now, we will be supporting:
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
instructions?)
rustfmtImplementation history
#155200