Stop setting edition strings in FeatureSets.

PiperOrigin-RevId: 563791580
pull/11928/head
Mike Kruskal 1 year ago committed by Copybara-Service
parent b2e39c175a
commit 6f3db03eb7
  1. 20
      src/google/protobuf/cpp_features.pb.cc
  2. 12
      src/google/protobuf/cpp_features.proto
  3. 111
      src/google/protobuf/descriptor.pb.cc
  4. 30
      src/google/protobuf/descriptor.proto
  5. 2
      src/google/protobuf/unittest_invalid_features.proto

@ -72,15 +72,15 @@ static const ::_pb::Message* const file_default_instances[] = {
};
const char descriptor_table_protodef_google_2fprotobuf_2fcpp_5ffeatures_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\"google/protobuf/cpp_features.proto\022\002pb"
"\032 google/protobuf/descriptor.proto\"\201\002\n\013C"
"ppFeatures\0228\n\022legacy_closed_enum\030\001 \001(\010B\034"
"\210\001\001\230\001\004\230\001\001\242\001\020\n\0042023\022\005false\030\350\007\022\\\n\017utf8_val"
"idation\030\002 \001(\0162\036.pb.CppFeatures.Utf8Valid"
"ationB#\210\001\001\230\001\004\230\001\001\242\001\027\n\0042023\022\014VERIFY_PARSE\030"
"\350\007\"Z\n\016Utf8Validation\022\033\n\027UTF8_VALIDATION_"
"UNKNOWN\020\000\022\020\n\014VERIFY_PARSE\020\001\022\017\n\013VERIFY_DL"
"OG\020\002\022\010\n\004NONE\020\003::\n\003cpp\022\033.google.protobuf."
"FeatureSet\030\350\007 \001(\0132\017.pb.CppFeatures"
"\032 google/protobuf/descriptor.proto\"\365\001\n\013C"
"ppFeatures\0222\n\022legacy_closed_enum\030\001 \001(\010B\026"
"\210\001\001\230\001\004\230\001\001\242\001\n\022\005false\030\350\007\022V\n\017utf8_validatio"
"n\030\002 \001(\0162\036.pb.CppFeatures.Utf8ValidationB"
"\035\210\001\001\230\001\004\230\001\001\242\001\021\022\014VERIFY_PARSE\030\350\007\"Z\n\016Utf8Va"
"lidation\022\033\n\027UTF8_VALIDATION_UNKNOWN\020\000\022\020\n"
"\014VERIFY_PARSE\020\001\022\017\n\013VERIFY_DLOG\020\002\022\010\n\004NONE"
"\020\003::\n\003cpp\022\033.google.protobuf.FeatureSet\030\350"
"\007 \001(\0132\017.pb.CppFeatures"
};
static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_deps[1] =
{
@ -90,7 +90,7 @@ static ::absl::once_flag descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2ep
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto = {
false,
false,
394,
382,
descriptor_table_protodef_google_2fprotobuf_2fcpp_5ffeatures_2eproto,
"google/protobuf/cpp_features.proto",
&descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_once,

@ -47,11 +47,7 @@ message CppFeatures {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "false"
}
edition_defaults = { edition_enum: EDITION_2023, value: "false" }
];
// The UTF8 validation strategy to use. See go/editions-utf8-validation for
@ -72,10 +68,6 @@ message CppFeatures {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "VERIFY_PARSE"
}
edition_defaults = { edition_enum: EDITION_2023, value: "VERIFY_PARSE" }
];
}

@ -1861,68 +1861,67 @@ const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] PR
"value\030\005 \001(\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014str"
"ing_value\030\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t"
"\0323\n\010NamePart\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_ex"
"tension\030\002 \002(\010\"\272\007\n\nFeatureSet\022b\n\016field_pr"
"tension\030\002 \002(\010\"\234\007\n\nFeatureSet\022\\\n\016field_pr"
"esence\030\001 \001(\0162).google.protobuf.FeatureSe"
"t.FieldPresenceB\037\210\001\001\230\001\004\230\001\001\242\001\023\n\0042023\022\010EXP"
"LICIT\030\350\007\022T\n\tenum_type\030\002 \001(\0162$.google.pro"
"tobuf.FeatureSet.EnumTypeB\033\210\001\001\230\001\006\230\001\001\242\001\017\n"
"\0042023\022\004OPEN\030\350\007\022q\n\027repeated_field_encodin"
"g\030\003 \001(\01621.google.protobuf.FeatureSet.Rep"
"eatedFieldEncodingB\035\210\001\001\230\001\004\230\001\001\242\001\021\n\0042023\022\006"
"PACKED\030\350\007\022m\n\020message_encoding\030\005 \001(\0162+.go"
"ogle.protobuf.FeatureSet.MessageEncoding"
"B&\210\001\001\230\001\004\230\001\001\242\001\032\n\0042023\022\017LENGTH_PREFIXED\030\350\007"
"\022\\\n\013json_format\030\006 \001(\0162&.google.protobuf."
"FeatureSet.JsonFormatB\037\210\001\001\230\001\003\230\001\006\230\001\001\242\001\020\n\004"
"2023\022\005ALLOW\030\350\007\"\\\n\rFieldPresence\022\032\n\026FIELD"
"_PRESENCE_UNKNOWN\020\000\022\014\n\010EXPLICIT\020\001\022\014\n\010IMP"
"LICIT\020\002\022\023\n\017LEGACY_REQUIRED\020\003\"7\n\010EnumType"
"\022\025\n\021ENUM_TYPE_UNKNOWN\020\000\022\010\n\004OPEN\020\001\022\n\n\006CLO"
"SED\020\002\"V\n\025RepeatedFieldEncoding\022#\n\037REPEAT"
"ED_FIELD_ENCODING_UNKNOWN\020\000\022\n\n\006PACKED\020\001\022"
"\014\n\010EXPANDED\020\002\"S\n\017MessageEncoding\022\034\n\030MESS"
"AGE_ENCODING_UNKNOWN\020\000\022\023\n\017LENGTH_PREFIXE"
"D\020\001\022\r\n\tDELIMITED\020\002\"H\n\nJsonFormat\022\027\n\023JSON"
"_FORMAT_UNKNOWN\020\000\022\t\n\005ALLOW\020\001\022\026\n\022LEGACY_B"
"EST_EFFORT\020\002*\006\010\350\007\020\351\007*\006\010\351\007\020\352\007*\006\010\213N\020\220NJ\004\010\004"
"\020\005J\006\010\347\007\020\350\007\"\223\003\n\022FeatureSetDefaults\022N\n\010def"
"aults\030\001 \003(\0132<.google.protobuf.FeatureSet"
"Defaults.FeatureSetEditionDefault\022\027\n\017min"
"imum_edition\030\002 \001(\t\022\027\n\017maximum_edition\030\003 "
"\001(\t\0226\n\024minimum_edition_enum\030\004 \001(\0162\030.goog"
"le.protobuf.Edition\0226\n\024maximum_edition_e"
"num\030\005 \001(\0162\030.google.protobuf.Edition\032\212\001\n\030"
"FeatureSetEditionDefault\022\017\n\007edition\030\001 \001("
"\t\022.\n\014edition_enum\030\003 \001(\0162\030.google.protobu"
"f.Edition\022-\n\010features\030\002 \001(\0132\033.google.pro"
"tobuf.FeatureSet\"\325\001\n\016SourceCodeInfo\022:\n\010l"
"ocation\030\001 \003(\0132(.google.protobuf.SourceCo"
"deInfo.Location\032\206\001\n\010Location\022\020\n\004path\030\001 \003"
"(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n\020leading_comm"
"ents\030\003 \001(\t\022\031\n\021trailing_comments\030\004 \001(\t\022!\n"
"\031leading_detached_comments\030\006 \003(\t\"\234\002\n\021Gen"
"eratedCodeInfo\022A\n\nannotation\030\001 \003(\0132-.goo"
"gle.protobuf.GeneratedCodeInfo.Annotatio"
"n\032\303\001\n\nAnnotation\022\020\n\004path\030\001 \003(\005B\002\020\001\022\023\n\013so"
"urce_file\030\002 \001(\t\022\r\n\005begin\030\003 \001(\005\022\013\n\003end\030\004 "
"\001(\005\022H\n\010semantic\030\005 \001(\01626.google.protobuf."
"GeneratedCodeInfo.Annotation.Semantic\"(\n"
"\010Semantic\022\010\n\004NONE\020\000\022\007\n\003SET\020\001\022\t\n\005ALIAS\020\002*"
"\300\001\n\007Edition\022\023\n\017EDITION_UNKNOWN\020\000\022\021\n\014EDIT"
"ION_2023\020\350\007\022\027\n\023EDITION_1_TEST_ONLY\020\001\022\027\n\023"
"EDITION_2_TEST_ONLY\020\002\022\035\n\027EDITION_99997_T"
"EST_ONLY\020\235\215\006\022\035\n\027EDITION_99998_TEST_ONLY\020"
"\236\215\006\022\035\n\027EDITION_99999_TEST_ONLY\020\237\215\006B~\n\023co"
"m.google.protobufB\020DescriptorProtosH\001Z-g"
"oogle.golang.org/protobuf/types/descript"
"orpb\370\001\001\242\002\003GPB\252\002\032Google.Protobuf.Reflecti"
"on"
"t.FieldPresenceB\031\210\001\001\230\001\004\230\001\001\242\001\r\022\010EXPLICIT\030"
"\350\007\022N\n\tenum_type\030\002 \001(\0162$.google.protobuf."
"FeatureSet.EnumTypeB\025\210\001\001\230\001\006\230\001\001\242\001\t\022\004OPEN\030"
"\350\007\022k\n\027repeated_field_encoding\030\003 \001(\01621.go"
"ogle.protobuf.FeatureSet.RepeatedFieldEn"
"codingB\027\210\001\001\230\001\004\230\001\001\242\001\013\022\006PACKED\030\350\007\022g\n\020messa"
"ge_encoding\030\005 \001(\0162+.google.protobuf.Feat"
"ureSet.MessageEncodingB \210\001\001\230\001\004\230\001\001\242\001\024\022\017LE"
"NGTH_PREFIXED\030\350\007\022V\n\013json_format\030\006 \001(\0162&."
"google.protobuf.FeatureSet.JsonFormatB\031\210"
"\001\001\230\001\003\230\001\006\230\001\001\242\001\n\022\005ALLOW\030\350\007\"\\\n\rFieldPresenc"
"e\022\032\n\026FIELD_PRESENCE_UNKNOWN\020\000\022\014\n\010EXPLICI"
"T\020\001\022\014\n\010IMPLICIT\020\002\022\023\n\017LEGACY_REQUIRED\020\003\"7"
"\n\010EnumType\022\025\n\021ENUM_TYPE_UNKNOWN\020\000\022\010\n\004OPE"
"N\020\001\022\n\n\006CLOSED\020\002\"V\n\025RepeatedFieldEncoding"
"\022#\n\037REPEATED_FIELD_ENCODING_UNKNOWN\020\000\022\n\n"
"\006PACKED\020\001\022\014\n\010EXPANDED\020\002\"S\n\017MessageEncodi"
"ng\022\034\n\030MESSAGE_ENCODING_UNKNOWN\020\000\022\023\n\017LENG"
"TH_PREFIXED\020\001\022\r\n\tDELIMITED\020\002\"H\n\nJsonForm"
"at\022\027\n\023JSON_FORMAT_UNKNOWN\020\000\022\t\n\005ALLOW\020\001\022\026"
"\n\022LEGACY_BEST_EFFORT\020\002*\006\010\350\007\020\351\007*\006\010\351\007\020\352\007*\006"
"\010\213N\020\220NJ\004\010\004\020\005J\006\010\347\007\020\350\007\"\223\003\n\022FeatureSetDefau"
"lts\022N\n\010defaults\030\001 \003(\0132<.google.protobuf."
"FeatureSetDefaults.FeatureSetEditionDefa"
"ult\022\027\n\017minimum_edition\030\002 \001(\t\022\027\n\017maximum_"
"edition\030\003 \001(\t\0226\n\024minimum_edition_enum\030\004 "
"\001(\0162\030.google.protobuf.Edition\0226\n\024maximum"
"_edition_enum\030\005 \001(\0162\030.google.protobuf.Ed"
"ition\032\212\001\n\030FeatureSetEditionDefault\022\017\n\007ed"
"ition\030\001 \001(\t\022.\n\014edition_enum\030\003 \001(\0162\030.goog"
"le.protobuf.Edition\022-\n\010features\030\002 \001(\0132\033."
"google.protobuf.FeatureSet\"\325\001\n\016SourceCod"
"eInfo\022:\n\010location\030\001 \003(\0132(.google.protobu"
"f.SourceCodeInfo.Location\032\206\001\n\010Location\022\020"
"\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n\020le"
"ading_comments\030\003 \001(\t\022\031\n\021trailing_comment"
"s\030\004 \001(\t\022!\n\031leading_detached_comments\030\006 \003"
"(\t\"\234\002\n\021GeneratedCodeInfo\022A\n\nannotation\030\001"
" \003(\0132-.google.protobuf.GeneratedCodeInfo"
".Annotation\032\303\001\n\nAnnotation\022\020\n\004path\030\001 \003(\005"
"B\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005begin\030\003 \001(\005"
"\022\013\n\003end\030\004 \001(\005\022H\n\010semantic\030\005 \001(\01626.google"
".protobuf.GeneratedCodeInfo.Annotation.S"
"emantic\"(\n\010Semantic\022\010\n\004NONE\020\000\022\007\n\003SET\020\001\022\t"
"\n\005ALIAS\020\002*\300\001\n\007Edition\022\023\n\017EDITION_UNKNOWN"
"\020\000\022\021\n\014EDITION_2023\020\350\007\022\027\n\023EDITION_1_TEST_"
"ONLY\020\001\022\027\n\023EDITION_2_TEST_ONLY\020\002\022\035\n\027EDITI"
"ON_99997_TEST_ONLY\020\235\215\006\022\035\n\027EDITION_99998_"
"TEST_ONLY\020\236\215\006\022\035\n\027EDITION_99999_TEST_ONLY"
"\020\237\215\006B~\n\023com.google.protobufB\020DescriptorP"
"rotosH\001Z-google.golang.org/protobuf/type"
"s/descriptorpb\370\001\001\242\002\003GPB\252\002\032Google.Protobu"
"f.Reflection"
};
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto = {
false,
false,
9402,
9372,
descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto,
"google/protobuf/descriptor.proto",
&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,

@ -934,11 +934,7 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "EXPLICIT"
}
edition_defaults = { edition_enum: EDITION_2023, value: "EXPLICIT" }
];
enum EnumType {
@ -950,11 +946,7 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "OPEN"
}
edition_defaults = { edition_enum: EDITION_2023, value: "OPEN" }
];
enum RepeatedFieldEncoding {
@ -966,11 +958,7 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "PACKED"
}
edition_defaults = { edition_enum: EDITION_2023, value: "PACKED" }
];
enum MessageEncoding {
@ -982,11 +970,7 @@ message FeatureSet {
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "LENGTH_PREFIXED"
}
edition_defaults = { edition_enum: EDITION_2023, value: "LENGTH_PREFIXED" }
];
enum JsonFormat {
@ -999,11 +983,7 @@ message FeatureSet {
targets = TARGET_TYPE_MESSAGE,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
edition_defaults = {
edition: "2023",
edition_enum: EDITION_2023,
value: "ALLOW"
}
edition_defaults = { edition_enum: EDITION_2023, value: "ALLOW" }
];
reserved 4, 999;

@ -42,6 +42,6 @@ message TestInvalidFeatures {
repeated int32 repeated_feature = 1 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
edition_defaults = { edition: "2023", value: "3" }
edition_defaults = { edition_enum: EDITION_2023, value: "3" }
];
}

Loading…
Cancel
Save