File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,10 @@ pub struct FieldAlreadyDeclared {
28
28
}
29
29
```
30
30
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.
33
35
34
36
If an error has an error code (e.g. "E0624"), then that can be specified using
35
37
the ` code ` sub-attribute. Specifying a ` code ` isn't mandatory, but if you are
@@ -243,7 +245,7 @@ pub enum ExpectedReturnTypeLabel<'tcx> {
243
245
}
244
246
```
245
247
246
- Unlike ` Diagnostic ` , ` Subdiagnostic ` can be applied to structs or
248
+ Like ` Diagnostic ` , ` Subdiagnostic ` can be applied to structs or
247
249
enums. Attributes that are placed on the type for structs are placed on each
248
250
variants for enums (or vice versa). Each ` Subdiagnostic ` should have one
249
251
attribute applied to the struct or each variant, one of:
You can’t perform that action at this time.
0 commit comments