error: unexpected `optional`
  --> testdata/options/validate/presence.proto:21:5
   |
21 |     optional int32 a1 = 10;
   |     ^^^^^^^^ expected type name or `repeated`
   |
  help: delete it
   |
21 | -     optional int32 a1 = 10;
21 | +     int32 a1 = 10;
   |
   |
   = help: in editions mode, the presence behavior of a singular field is
           controlled with `[feature.field_presence = ...]`, with the default
           being equivalent to a proto2 `optional` field
   = help: see <https://protobuf.com/docs/language-spec#field-presence>

error: unexpected `required`
  --> testdata/options/validate/presence.proto:22:5
   |
22 |     required int32 a2 = 11;
   |     ^^^^^^^^ expected type name or `repeated`
   |
  help: delete it
   |
22 | -     required int32 a2 = 11;
22 | +     int32 a2 = 11;
   |
   |
   = help: required fields are only permitted in proto2; even then, their use is
           strongly discouraged

error: cannot set `LEGACY_REQUIRED` at the file level
  --> testdata/options/validate/presence.proto:5:34
   |
 5 | option features.field_presence = LEGACY_REQUIRED;
   |                                  ^^^^^^^^^^^^^^^

error: expected singular field, found repeated field
  --> testdata/options/validate/presence.proto:8:5
   |
 8 |     repeated int32 x = 1 [features.field_presence = EXPLICIT];
   |     ^^^^^^^^^^^^^^        ----------------------- `field_presence` set here
   |
   = help: `field_presence` can only be set on singular fields

error: expected singular field, found map field
  --> testdata/options/validate/presence.proto:9:5
   |
 9 |     map<int32, int32> y = 2 [features.field_presence = EXPLICIT];
   |     ^^^^^^^^^^^^^^^^^        -----------------------
   |                               |
   |                               `field_presence` set here
   |
   = help: `field_presence` can only be set on singular fields

error: expected singular field, found oneof member
  --> testdata/options/validate/presence.proto:12:9
   |
11 | /     oneof o {
12 | |         int32 z = 3 [features.field_presence = EXPLICIT];
   | |         ^^^^^^^^^^^^^-----------------------^^^^^^^^^^^^^
   | |                       |
   | |                       `field_presence` set here
13 | |     }
   | \_____- defined in this oneof
   |
   = help: `field_presence` cannot be set on oneof members
   = help: all oneof members have explicit presence

error: expected message type, found message type `buf.test.Foo`
  --> testdata/options/validate/presence.proto:17:5
   |
17 |     Foo m = 5 [features.field_presence = IMPLICIT];
   |     ^^^                                  --------
   |     ---                                   |
   |                                           |
   |                                           implicit presence set here
   |
   = help: all message-typed fields explicit presence

warning: required fields are deprecated
  --> testdata/options/validate/presence.proto:19:44
   |
19 |     int32 r = 6 [features.field_presence = LEGACY_REQUIRED];
   |                                            ^^^^^^^^^^^^^^^
   = help: do not attempt to change this to `EXPLICIT` if the field is already
           in-use; doing so is a wire protocol break

error: expected singular field, found extension
  --> testdata/options/validate/presence.proto:26:5
   |
26 |     int32 e = 4 [features.field_presence = EXPLICIT];
   |     ^^^^^^^^^^^^^-----------------------^^^^^^^^^^^^^
   |                   |
   |                   `field_presence` set here
   |
   = help: `field_presence` cannot be set on extensions
   = help: all singular extensions have explicit presence

encountered 8 errors and 1 warning
