@@ -12,14 +12,36 @@ macro_rules! int_module {
12
12
( $T: ident, #[ $attr: meta] ) => (
13
13
doc_comment! {
14
14
concat!( "The smallest value that can be represented by this integer type.
15
- Use [`" , stringify!( $T) , "::MIN" , "`](../../std/primitive." , stringify!( $T) , ".html#associatedconstant.MIN) instead." ) ,
15
+ Use [`" , stringify!( $T) , "::MIN" , "`](../../std/primitive." , stringify!( $T) , ".html#associatedconstant.MIN) instead.
16
+
17
+ # Examples
18
+
19
+ ```rust
20
+ // deprecated way
21
+ let min = std::" , stringify!( $T) , "::MIN;
22
+
23
+ // intended way
24
+ let min = " , stringify!( $T) , "::MIN;
25
+ ```
26
+ " ) ,
16
27
#[ $attr]
17
28
pub const MIN : $T = $T:: MIN ;
18
29
}
19
30
20
31
doc_comment! {
21
32
concat!( "The largest value that can be represented by this integer type.
22
- Use [`" , stringify!( $T) , "::MAX" , "`](../../std/primitive." , stringify!( $T) , ".html#associatedconstant.MAX) instead." ) ,
33
+ Use [`" , stringify!( $T) , "::MAX" , "`](../../std/primitive." , stringify!( $T) , ".html#associatedconstant.MAX) instead.
34
+
35
+ # Examples
36
+
37
+ ```rust
38
+ // deprecated way
39
+ let max = std::" , stringify!( $T) , "::MAX;
40
+
41
+ // intended way
42
+ let max = " , stringify!( $T) , "::MAX;
43
+ ```
44
+ " ) ,
23
45
#[ $attr]
24
46
pub const MAX : $T = $T:: MAX ;
25
47
}
0 commit comments