Repository navigation
descriptor: report missing extendee and method types by name - #808
Open
bniladridas wants to merge 1 commit into
Open
bniladridas wants to merge 1 commit into
bniladridas wants to merge 1 commit into
Conversation
`PoolError::MissingTypeName` is emitted for a field with no `type_name`, but also for an extension with no `extendee` and a method with no `input_type` or `output_type`, so its message reports those declarations as fields and names neither the missing attribute nor the declaration kind.
Emit `MissingExtendee { extension }` for an extension without an extendee, and `MissingMethodInputType { method }` or `MissingMethodOutputType { method }` for a method missing its input or output type. `MissingTypeName { field }` keeps its shape and message and is now emitted only for fields. The new variants are additive on the non-exhaustive `PoolError` enum.
Refs anthropics#641
Signed-off-by: Niladri Das <125604915+bniladridas@users.noreply.github.com>
|
All contributors have signed the CLA ✍️ ✅ |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clarify
PoolErrordiagnostics for missing descriptor type references.MissingTypeName { field }and its existing message for fields.MissingExtendee { extension }for extensions without an extendee.MissingMethodInputType { method }andMissingMethodOutputType { method }for methods missing their input or output type.This changes which
PoolErrorvariant is returned for missing extension and method attributes. Field behavior remains unchanged.InvalidJsonNameandMalformedMapEntryare unchanged. The JSON-name work remains covered by #756.Validation
cargo fmt --all -- --checkcargo test -p buffa-descriptor --features reflectcargo test -p buffa-descriptor --no-default-features --features json,reflect --test '*'cargo clippy -p buffa-descriptor --features reflect --all-targets -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc -p buffa-descriptor --features reflect --no-depsgit diff --checkAll listed checks passed. The changelog fragment was checked manually; Changie was unavailable in the local environment.
Refs #641