@@ -499,17 +499,17 @@ The `cold` and `inline` attributes give suggestions to the compiler to compile
499499your code in a way that may be faster than what it would do without the hint .
500500The attributes are only suggestions , and the compiler may choose to ignore it .
501501
502+ Both attributes can be used on closures , [functions ] and function prototypes ,
503+ although they do not do anything on function prototypes . When applied to a
504+ function in a [trait ], they apply only to that function when used as a default
505+ function for a trait implementation and not to all trait implementations .
506+
502507#### `inline ` Attribute
503508
504509The * `inline ` attribute * suggests to the compiler that it should place a copy of
505510the attributed function in the caller , rather than generating code to call the
506511function where it is defined .
507512
508- This attribute can be used on [functions ] and function prototypes , although it
509- does not do anything on function prototypes . When this attribute is applied to
510- a function in a [trait ], it applies only to that function when used as a default
511- function for a trait implementation and not to all trait implementations .
512-
513513> ** * Note *** : The compiler automatically inlines functions based on internal
514514> heuristics . Incorrectly inlining functions can actually make the program
515515> slower , so this attribute should be used with care .
@@ -522,13 +522,8 @@ There are three ways of using the inline attribute:
522522
523523#### `cold ` Attribute
524524
525- The * `cold ` attribute * suggests to the compiler that the attributed function is
526- unlikely to be called .
527-
528- This attribute can be used on [functions ] and function prototypes , although it
529- does not do anything on function prototypes . When this attribute is applied to
530- a function in a [trait ], it applies only to that function when used as a default
531- function for a trait implementation and not to all trait implementations .
525+ The * `cold ` attribute * suggests to the compiler that the attributed function or
526+ closure is unlikely to be called .
532527
533528### `derive `
534529
0 commit comments