@@ -68,7 +68,7 @@ macro_rules! newtype_index {
68
68
@pub [ $( $pub: tt) * ]
69
69
@type [ $type: ident]
70
70
@max [ $max: expr]
71
- @debug_format [ $debug_format: expr ] ) => (
71
+ @debug_format [ $debug_format: tt ] ) => (
72
72
#[ derive( Copy , Clone , PartialEq , Eq , Hash , PartialOrd , Ord , $( $derives) ,* ) ]
73
73
pub struct $type( $( $pub) * u32 ) ;
74
74
@@ -100,7 +100,7 @@ macro_rules! newtype_index {
100
100
( @handle_debug
101
101
@derives [ ]
102
102
@type [ $type: ident]
103
- @debug_format [ $debug_format: expr ] ) => (
103
+ @debug_format [ $debug_format: tt ] ) => (
104
104
impl :: std:: fmt:: Debug for $type {
105
105
fn fmt( & self , fmt: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
106
106
write!( fmt, $debug_format, self . 0 )
@@ -112,13 +112,13 @@ macro_rules! newtype_index {
112
112
( @handle_debug
113
113
@derives [ Debug , $( $derives: ident, ) * ]
114
114
@type [ $type: ident]
115
- @debug_format [ $debug_format: expr ] ) => ( ) ;
115
+ @debug_format [ $debug_format: tt ] ) => ( ) ;
116
116
117
117
// It's not Debug, so just pop it off the front of the derives stack and check the rest.
118
118
( @handle_debug
119
119
@derives [ $_derive: ident, $( $derives: ident, ) * ]
120
120
@type [ $type: ident]
121
- @debug_format [ $debug_format: expr ] ) => (
121
+ @debug_format [ $debug_format: tt ] ) => (
122
122
newtype_index!(
123
123
@handle_debug
124
124
@derives [ $( $derives, ) * ]
@@ -129,7 +129,7 @@ macro_rules! newtype_index {
129
129
// Handle the case where someone wants to make the internal field public
130
130
( @type [ $type: ident]
131
131
@max [ $max: expr]
132
- @debug_format [ $debug_format: expr ]
132
+ @debug_format [ $debug_format: tt ]
133
133
pub idx
134
134
$( $tokens: tt) * ) => (
135
135
newtype_index!(
@@ -143,7 +143,7 @@ macro_rules! newtype_index {
143
143
// The default case is that the internal field is private
144
144
( @type [ $type: ident]
145
145
@max [ $max: expr]
146
- @debug_format [ $debug_format: expr ]
146
+ @debug_format [ $debug_format: tt ]
147
147
$( $tokens: tt) * ) => (
148
148
newtype_index!(
149
149
@pub [ ]
@@ -157,7 +157,7 @@ macro_rules! newtype_index {
157
157
( @pub [ $( $pub: tt) * ]
158
158
@type [ $type: ident]
159
159
@max [ $max: expr]
160
- @debug_format [ $debug_format: expr ]
160
+ @debug_format [ $debug_format: tt ]
161
161
derive [ $( $derives: ident) ,* ]
162
162
$( $tokens: tt) * ) => (
163
163
newtype_index!(
@@ -174,7 +174,7 @@ macro_rules! newtype_index {
174
174
( @pub [ $( $pub: tt) * ]
175
175
@type [ $type: ident]
176
176
@max [ $max: expr]
177
- @debug_format [ $debug_format: expr ]
177
+ @debug_format [ $debug_format: tt ]
178
178
derive [ $( $derives: ident, ) +]
179
179
ENCODABLE = custom
180
180
$( $tokens: tt) * ) => (
@@ -192,7 +192,7 @@ macro_rules! newtype_index {
192
192
( @pub [ $( $pub: tt) * ]
193
193
@type [ $type: ident]
194
194
@max [ $max: expr]
195
- @debug_format [ $debug_format: expr ]
195
+ @debug_format [ $debug_format: tt ]
196
196
derive [ $( $derives: ident, ) +]
197
197
$( $tokens: tt) * ) => (
198
198
newtype_index!(
@@ -209,7 +209,7 @@ macro_rules! newtype_index {
209
209
( @pub [ $( $pub: tt) * ]
210
210
@type [ $type: ident]
211
211
@max [ $max: expr]
212
- @debug_format [ $debug_format: expr ]
212
+ @debug_format [ $debug_format: tt ]
213
213
ENCODABLE = custom
214
214
$( $tokens: tt) * ) => (
215
215
newtype_index!(
@@ -225,7 +225,7 @@ macro_rules! newtype_index {
225
225
( @pub [ $( $pub: tt) * ]
226
226
@type [ $type: ident]
227
227
@max [ $max: expr]
228
- @debug_format [ $debug_format: expr ]
228
+ @debug_format [ $debug_format: tt ]
229
229
$( $tokens: tt) * ) => (
230
230
newtype_index!(
231
231
@derives [ RustcDecodable , RustcEncodable , ]
@@ -241,7 +241,7 @@ macro_rules! newtype_index {
241
241
@pub [ $( $pub: tt) * ]
242
242
@type [ $type: ident]
243
243
@max [ $max: expr]
244
- @debug_format [ $debug_format: expr ]
244
+ @debug_format [ $debug_format: tt ]
245
245
$name: ident = $constant: expr) => (
246
246
newtype_index!(
247
247
@derives [ $( $derives, ) * ]
@@ -257,7 +257,7 @@ macro_rules! newtype_index {
257
257
@pub [ $( $pub: tt) * ]
258
258
@type [ $type: ident]
259
259
@max [ $_max: expr]
260
- @debug_format [ $debug_format: expr ]
260
+ @debug_format [ $debug_format: tt ]
261
261
$( #[ doc = $doc: expr] ) *
262
262
const $name: ident = $constant: expr) => (
263
263
newtype_index!(
@@ -274,7 +274,7 @@ macro_rules! newtype_index {
274
274
@pub [ $( $pub: tt) * ]
275
275
@type [ $type: ident]
276
276
@max [ $_max: expr]
277
- @debug_format [ $debug_format: expr ]
277
+ @debug_format [ $debug_format: tt ]
278
278
MAX = $max: expr,
279
279
$( $tokens: tt) * ) => (
280
280
newtype_index!(
@@ -291,8 +291,8 @@ macro_rules! newtype_index {
291
291
@pub [ $( $pub: tt) * ]
292
292
@type [ $type: ident]
293
293
@max [ $max: expr]
294
- @debug_format [ $_debug_format: expr ]
295
- DEBUG_FORMAT = $debug_format: expr ,
294
+ @debug_format [ $_debug_format: tt ]
295
+ DEBUG_FORMAT = $debug_format: tt ,
296
296
$( $tokens: tt) * ) => (
297
297
newtype_index!(
298
298
@derives [ $( $derives, ) * ]
@@ -308,7 +308,7 @@ macro_rules! newtype_index {
308
308
@pub [ $( $pub: tt) * ]
309
309
@type [ $type: ident]
310
310
@max [ $max: expr]
311
- @debug_format [ $debug_format: expr ]
311
+ @debug_format [ $debug_format: tt ]
312
312
$( #[ doc = $doc: expr] ) *
313
313
const $name: ident = $constant: expr,
314
314
$( $tokens: tt) * ) => (
0 commit comments