You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/types/generics.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -548,26 +548,25 @@ The inferred const cannot be used in item signatures.
548
548
> ```
549
549
550
550
r[generics.parameters.attributes]
551
-
## Attributes
551
+
## Attributes on generic parameters
552
552
553
-
Generic parameters allow [attributes] on them. There are no built-in attributes that do anything in this position, although custom derive attributes may give meaning to it.
554
-
555
-
This example shows using a custom derive attribute to modify the meaning of a generic parameter.
553
+
The [built-in attributes] that have meaning on a generic parameter are [`cfg`] and [the lint check attributes].
556
554
557
555
> [!EXAMPLE]
558
-
> <!-- ignore: requires proc macro derive -->
559
-
> ```rust,ignore
560
-
> // Assume that the derive for MyFlexibleClone declared `my_flexible_clone` as
0 commit comments