From baff648fbb571d1bbf3f1c9ef9ca91142e99be3b Mon Sep 17 00:00:00 2001 From: TJ Yin Date: Thu, 30 Jan 2025 01:19:10 -0800 Subject: [PATCH] Add @cpp.AllowLegacyDeprecatedTerseWritesRef to allow using cpp.Ref with deprecated_terse_writes cpp2 option Summary: We will ban such usages without this annotation. Reviewed By: thedavekwon Differential Revision: D68802575 fbshipit-source-id: 16a60085e3951f0f3ce64e46040d210b9ef93cc9 --- thrift/annotation/cpp.thrift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/thrift/annotation/cpp.thrift b/thrift/annotation/cpp.thrift index ef5163ea7ab08..9da69d73576c1 100644 --- a/thrift/annotation/cpp.thrift +++ b/thrift/annotation/cpp.thrift @@ -403,3 +403,13 @@ struct AllowLegacyNonOptionalRef {} */ @scope.Field struct DeprecatedTerseWrite {} + +/** + * Allows the field to be annotated @cpp.Ref (or cpp[2].ref[_type]) even if it + * is deprecated_terse_writes field. + * + * This annotation is provided for a limited time, to exempt pre-existing fields + * while rolling out a stricter enforcement of the condition above. + */ +@scope.Field +struct AllowLegacyDeprecatedTerseWritesRef {}