File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,10 @@ pub struct FieldAlreadyDeclared {
2828}
2929```
3030
31- ` Diagnostic ` can only be applied to structs. Every ` Diagnostic `
32- has to have one attribute, ` #[diag(...)] ` , applied to the struct itself.
31+ ` Diagnostic ` can only be applied to structs and enums.
32+ Attributes that are placed on the type for structs are placed on each
33+ variants for enums (or vice versa). Each ` Diagnostic ` has to have one
34+ attribute, ` #[diag(...)] ` , applied to the struct or each enum variant.
3335
3436If an error has an error code (e.g. "E0624"), then that can be specified using
3537the ` code ` sub-attribute. Specifying a ` code ` isn't mandatory, but if you are
@@ -243,7 +245,7 @@ pub enum ExpectedReturnTypeLabel<'tcx> {
243245}
244246```
245247
246- Unlike ` Diagnostic ` , ` Subdiagnostic ` can be applied to structs or
248+ Like ` Diagnostic ` , ` Subdiagnostic ` can be applied to structs or
247249enums. Attributes that are placed on the type for structs are placed on each
248250variants for enums (or vice versa). Each ` Subdiagnostic ` should have one
249251attribute applied to the struct or each variant, one of:
You can’t perform that action at this time.
0 commit comments