Skip to content

Commit 9bec852

Browse files
aristidispmeta-codesync[bot]
authored andcommitted
fbcode/thrift/
Reviewed By: iahs Differential Revision: D95161022 fbshipit-source-id: 839bb9f55754a335804269ca25deac49a652483d
1 parent 0b35247 commit 9bec852

22 files changed

Lines changed: 57 additions & 0 deletions

third-party/thrift/src/thrift/lib/cpp2/test/ObjectTest.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ struct BoolList {
4343
struct MyStruct {
4444
1: optional Foo foo;
4545
2: optional list<Foo> foo_vector;
46+
@thrift.AllowUnsafeNonSealedKeyType
4647
3: optional set<Foo> foo_set;
48+
@thrift.AllowUnsafeNonSealedKeyType
4749
4: optional map<Foo, i32> foo_key_map;
4850
5: optional map<i32, Foo> foo_value_map;
4951
6: optional AdaptedFoo foo_adapted;

third-party/thrift/src/thrift/lib/cpp2/test/except.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct MyArgs {
4747
@thrift.AllowUnsafeRequiredFieldQualifier
4848
6: required map<i32, Inner> mi;
4949
@thrift.AllowUnsafeRequiredFieldQualifier
50+
@thrift.AllowUnsafeNonSealedKeyType
5051
7: required map<Inner, i32> complex_key;
5152
}
5253

@@ -70,6 +71,7 @@ struct MyArgs2 {
7071
4: optional map<string, i32> m;
7172
5: optional list<Inner2> li;
7273
6: optional map<i32, Inner2> mi;
74+
@thrift.AllowUnsafeNonSealedKeyType
7375
7: optional map<Inner2, i32> complex_key;
7476
}
7577

third-party/thrift/src/thrift/lib/cpp2/util/test/DebugTree.thrift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ struct SharedPtr {
8585
}
8686

8787
typedef list<MyDef> MyDefList
88+
@thrift.AllowUnsafeNonSealedKeyType
8889
typedef set<MyDef> MyDefSet
8990
typedef map<i32, MyDef> MyDefMap
9091

third-party/thrift/src/thrift/lib/py3/test/pickle_thrift.thrift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ exception nested_pickle_exception {
4343
struct struct_container {
4444
1: list<easy_pickle> list_easy;
4545
# @lint-ignore THRIFTCHECKS
46+
@thrift.AllowUnsafeNonSealedKeyType
4647
2: set<easy_pickle> set_easy;
4748
# @lint-ignore THRIFTCHECKS
49+
@thrift.AllowUnsafeNonSealedKeyType
4850
3: map<easy_pickle, easy_pickle> map_easy_easy;
4951
4: list<list<easy_pickle>> list_list_easy;
5052
# @lint-ignore THRIFTCHECKS
@@ -61,15 +63,19 @@ struct struct_container {
6163
union union_container {
6264
1: list<easy_pickle> list_easy;
6365
# @lint-ignore THRIFTCHECKS
66+
@thrift.AllowUnsafeNonSealedKeyType
6467
2: set<easy_pickle> set_easy;
6568
# @lint-ignore THRIFTCHECKS
69+
@thrift.AllowUnsafeNonSealedKeyType
6670
3: map<easy_pickle, easy_pickle> map_easy_easy;
6771
}
6872

6973
exception exception_container {
7074
1: list<easy_pickle> list_easy;
7175
# @lint-ignore THRIFTCHECKS
76+
@thrift.AllowUnsafeNonSealedKeyType
7277
2: set<easy_pickle> set_easy;
7378
# @lint-ignore THRIFTCHECKS
79+
@thrift.AllowUnsafeNonSealedKeyType
7480
3: map<easy_pickle, easy_pickle> map_easy_easy;
7581
}

third-party/thrift/src/thrift/lib/python/test/containers.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ struct Sets {
8181
97: set<binary> binarySet;
8282
93: set<IOBuf> iobufSet;
8383
# @lint-ignore THRIFTCHECKS
84+
@thrift.AllowUnsafeNonSealedKeyType
8485
2: set<Foo> structSet;
8586
47: set<Color> colorSet;
8687
}
@@ -103,6 +104,7 @@ struct Maps {
103104
97: map<binary, binary> binaryMap;
104105
93: map<IOBuf, IOBuf> iobufMap;
105106
# @lint-ignore THRIFTCHECKS
107+
@thrift.AllowUnsafeNonSealedKeyType
106108
2: map<Foo, Foo> structMap;
107109
47: map<Color, Color> colorMap;
108110
}

third-party/thrift/src/thrift/lib/python/test/refs.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ struct ComplexRef {
2727
3: optional list<i16> list_basetype_ref;
2828
4: optional list<ComplexRef> list_recursive_ref;
2929
5: optional set<i16> set_basetype_ref;
30+
@thrift.AllowUnsafeNonSealedKeyType
3031
6: optional set<ComplexRef> set_recursive_ref;
3132
7: optional map<i16, i16> map_basetype_ref;
3233
8: optional map<i16, ComplexRef> map_recursive_ref;
3334
9: optional list<ComplexRef> list_shared_ref;
35+
@thrift.AllowUnsafeNonSealedKeyType
3436
10: optional set<ComplexRef> set_const_shared_ref;
3537
11: optional ComplexRef recursive;
3638
}

third-party/thrift/src/thrift/lib/python/test/sets.thrift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace py3 python_test
2929
typedef string AtoIValue
3030

3131
typedef list<i32> I32List
32+
@thrift.AllowUnsafeNonSealedKeyType
3233
typedef set<easy> EasySet
3334
typedef set<i32> SetI32
3435
typedef set<AtoIValue> SetAtoIValue

third-party/thrift/src/thrift/lib/python/test/testing.thrift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ typedef float Float
104104
typedef double Double
105105
@thrift.AllowLegacyTypedefUri
106106
typedef list<easy> EasyList
107+
@thrift.AllowUnsafeNonSealedKeyType
107108
@thrift.AllowLegacyTypedefUri
108109
typedef set<easy> EasySet
109110
@thrift.AllowLegacyTypedefUri
@@ -487,6 +488,7 @@ union ReservedUnion {
487488
}
488489

489490
struct EdgeCaseStruct {
491+
@thrift.AllowUnsafeNonSealedKeyType
490492
1: map<Reserved, list<i64>> reservedValues;
491493
}
492494

@@ -522,6 +524,7 @@ struct SortedSets {
522524
2: set<string> strings;
523525
// @lint-ignore THRIFTCHECKS
524526
@python.DeprecatedSortSetOnSerialize
527+
@thrift.AllowUnsafeNonSealedKeyType
525528
3: set<easy> easies;
526529
@python.DeprecatedSortSetOnSerialize
527530
4: set<Color> colors;
@@ -534,6 +537,7 @@ struct SortedMaps {
534537
2: map<string, string> strings;
535538
// @lint-ignore THRIFTCHECKS
536539
@python.DeprecatedKeySortMapOnSerialize
540+
@thrift.AllowUnsafeNonSealedKeyType
537541
3: map<easy, easy> easies;
538542
@python.DeprecatedSortSetOnSerialize
539543
4: map<Color, Color> colors;
@@ -550,6 +554,7 @@ struct ComplexRef {
550554
@cpp.Ref{type = cpp.RefType.Unique}
551555
5: optional set<i16> set_basetype_ref;
552556
@cpp.Ref{type = cpp.RefType.Unique}
557+
@thrift.AllowUnsafeNonSealedKeyType
553558
6: optional set<ComplexRef> set_recursive_ref;
554559
@cpp.Ref{type = cpp.RefType.Unique}
555560
7: optional map<i16, i16> map_basetype_ref;
@@ -558,6 +563,7 @@ struct ComplexRef {
558563
@cpp.Ref{type = cpp.RefType.SharedMutable}
559564
9: optional list<ComplexRef> list_shared_ref;
560565
@cpp.Ref{type = cpp.RefType.Shared}
566+
@thrift.AllowUnsafeNonSealedKeyType
561567
10: optional set<ComplexRef> set_const_shared_ref;
562568
@thrift.Box
563569
11: optional ComplexRef recursive;
@@ -575,6 +581,7 @@ struct Complex {
575581
8: ComplexUnion val_union;
576582
9: list<i64> val_list;
577583
// @lint-ignore THRIFTCHECKS
584+
@thrift.AllowUnsafeNonSealedKeyType
578585
10: optional set<easy> val_set;
579586
11: map<string, binary> val_map;
580587
// @lint-ignore THRIFTCHECKS

third-party/thrift/src/thrift/lib/rust/src/dep_tests/test_thrift.thrift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct SubStruct {
3535
@thrift.AllowUnsafeRequiredFieldQualifier
3636
2: required string req_def = "IAMREQ";
3737
// @lint-ignore THRIFTCHECKS
38+
@thrift.AllowUnsafeNonSealedKeyType
3839
3: optional map<Small, i32> key_map;
3940
4: binary bin;
4041
}

third-party/thrift/src/thrift/lib/thrift/protocol_detail.thrift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ union Value {
110110
reason = "Set can only have integer/string/binary/enum values",
111111
}
112112
@cpp.AllowLegacyNonOptionalRef
113+
@thrift.AllowUnsafeNonSealedKeyType
113114
15: set<Value> setValue;
114115

115116
// TODO(dokwon): Migrate to @thrift.Box after resolving incomplete type.
116117
@cpp.Ref{type = cpp.RefType.Unique}
117118
@cpp.Type{template = "::folly::F14FastMap"}
118119
@hack.SkipCodegen{reason = "Map keys can only be integer/string/binary/enum"}
119120
@cpp.AllowLegacyNonOptionalRef
121+
@thrift.AllowUnsafeNonSealedKeyType
120122
16: map<Value, Value> mapValue;
121123
}

0 commit comments

Comments
 (0)