Skip to content

Commit f9941ec

Browse files
pzmarzlyfacebook-github-bot
authored andcommitted
Update scope of rust.Serde
Reviewed By: slawlor Differential Revision: D68773604 fbshipit-source-id: c7c20de28f5cc5b1ade4e64ed818d61e4d034a13
1 parent d4587fb commit f9941ec

File tree

4 files changed

+41
-23
lines changed

4 files changed

+41
-23
lines changed

thrift/annotation/rust.thrift

+2
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ struct Type {
272272
// Selectively enable/disable derivation of serde serialization functions for a
273273
// given type.
274274
@scope.Struct
275+
@scope.Enum
276+
@scope.Union
275277
struct Serde {
276278
1: bool enabled;
277279
}

thrift/compiler/test/fixtures/adapter/out/hack/gen-hack/rust_types.php

+8
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,14 @@ public static function getAllStructuredAnnotations()[write_props]: \TStructAnnot
933933
shape(
934934
)
935935
),
936+
'\facebook\thrift\annotation\Enum' => \facebook\thrift\annotation\Enum::fromShape(
937+
shape(
938+
)
939+
),
940+
'\facebook\thrift\annotation\Union' => \facebook\thrift\annotation\Union::fromShape(
941+
shape(
942+
)
943+
),
936944
],
937945
'fields' => dict[
938946
],

thrift/compiler/test/fixtures/adapter/out/json/gen-json/rust.json

+23-23
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@
208208
"required" : true,
209209
"source_range" : {
210210
"begin" : {
211-
"line" : 276,
211+
"line" : 278,
212212
"column" : 3
213213
},
214214
"end" : {
215-
"line" : 276,
215+
"line" : 278,
216216
"column" : 19
217217
}
218218
}
@@ -224,13 +224,13 @@
224224
"column" : 1
225225
},
226226
"end" : {
227-
"line" : 277,
227+
"line" : 279,
228228
"column" : 2
229229
}
230230
}
231231
},
232232
"Mod" : {
233-
"lineno" : 283,
233+
"lineno" : 285,
234234
"is_exception" : false,
235235
"is_union" : false,
236236
"fields" : {
@@ -240,29 +240,29 @@
240240
"required" : true,
241241
"source_range" : {
242242
"begin" : {
243-
"line" : 285,
243+
"line" : 287,
244244
"column" : 3
245245
},
246246
"end" : {
247-
"line" : 285,
247+
"line" : 287,
248248
"column" : 18
249249
}
250250
}
251251
}
252252
},
253253
"source_range" : {
254254
"begin" : {
255-
"line" : 283,
255+
"line" : 285,
256256
"column" : 1
257257
},
258258
"end" : {
259-
"line" : 286,
259+
"line" : 288,
260260
"column" : 2
261261
}
262262
}
263263
},
264264
"Adapter" : {
265-
"lineno" : 288,
265+
"lineno" : 290,
266266
"is_exception" : false,
267267
"is_union" : false,
268268
"fields" : {
@@ -272,29 +272,29 @@
272272
"required" : true,
273273
"source_range" : {
274274
"begin" : {
275-
"line" : 333,
275+
"line" : 335,
276276
"column" : 3
277277
},
278278
"end" : {
279-
"line" : 333,
279+
"line" : 335,
280280
"column" : 18
281281
}
282282
}
283283
}
284284
},
285285
"source_range" : {
286286
"begin" : {
287-
"line" : 288,
287+
"line" : 290,
288288
"column" : 1
289289
},
290290
"end" : {
291-
"line" : 334,
291+
"line" : 336,
292292
"column" : 2
293293
}
294294
}
295295
},
296296
"Derive" : {
297-
"lineno" : 336,
297+
"lineno" : 338,
298298
"is_exception" : false,
299299
"is_union" : false,
300300
"fields" : {
@@ -304,29 +304,29 @@
304304
"required" : true,
305305
"source_range" : {
306306
"begin" : {
307-
"line" : 359,
307+
"line" : 361,
308308
"column" : 3
309309
},
310310
"end" : {
311-
"line" : 359,
311+
"line" : 361,
312312
"column" : 27
313313
}
314314
}
315315
}
316316
},
317317
"source_range" : {
318318
"begin" : {
319-
"line" : 336,
319+
"line" : 338,
320320
"column" : 1
321321
},
322322
"end" : {
323-
"line" : 360,
323+
"line" : 362,
324324
"column" : 2
325325
}
326326
}
327327
},
328328
"ServiceExn" : {
329-
"lineno" : 362,
329+
"lineno" : 364,
330330
"is_exception" : false,
331331
"is_union" : false,
332332
"fields" : {
@@ -336,23 +336,23 @@
336336
"required" : true,
337337
"source_range" : {
338338
"begin" : {
339-
"line" : 413,
339+
"line" : 415,
340340
"column" : 3
341341
},
342342
"end" : {
343-
"line" : 413,
343+
"line" : 415,
344344
"column" : 37
345345
}
346346
}
347347
}
348348
},
349349
"source_range" : {
350350
"begin" : {
351-
"line" : 362,
351+
"line" : 364,
352352
"column" : 1
353353
},
354354
"end" : {
355-
"line" : 414,
355+
"line" : 416,
356356
"column" : 2
357357
}
358358
}

thrift/compiler/test/fixtures/hack_service/out/hack_module2_with_patch/gen-hack/rust_types.php

+8
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,14 @@ public static function getAllStructuredAnnotations()[write_props]: \TStructAnnot
738738
shape(
739739
)
740740
),
741+
'\facebook\thrift\annotation\Enum' => \facebook\thrift\annotation\Enum::fromShape(
742+
shape(
743+
)
744+
),
745+
'\facebook\thrift\annotation\Union' => \facebook\thrift\annotation\Union::fromShape(
746+
shape(
747+
)
748+
),
741749
],
742750
'fields' => dict[
743751
],

0 commit comments

Comments
 (0)