mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #1426] [MERGED] add non_exhaustive to public enums #2312
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#2312
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/1426
Author: @bluejekyll
Created: 3/28/2021
Status: ✅ Merged
Merged: 4/6/2021
Merged by: @djc
Base:
main← Head:non_exhaustive_patterns📝 Commits (4)
5e3ab3badd non_exhaustive to public enums284320awarn on not fully matched enums in some cases4dd41f2mark ResolverOpts and DnsRequestOptions as non_exhaustive2642183updated CHANGELOG for resolver non_exhaustive📊 Changes
32 files changed (+100 additions, -64 deletions)
View changed files
📝
CHANGELOG.md(+7 -0)📝
Cargo.lock(+0 -2)📝
bin/src/named.rs(+4 -0)📝
crates/client/src/error/client_error.rs(+1 -0)📝
crates/client/src/error/dnssec_error.rs(+1 -0)📝
crates/client/src/error/lexer_error.rs(+1 -0)📝
crates/client/src/error/parse_error.rs(+6 -0)📝
crates/client/src/rr/dnssec/key_format.rs(+0 -2)📝
crates/client/src/rr/dnssec/keypair.rs(+0 -2)📝
crates/client/src/serialize/txt/parse_rdata.rs(+32 -23)📝
crates/https/src/error.rs(+1 -0)📝
crates/proto/src/error.rs(+1 -0)📝
crates/proto/src/rr/dnssec/algorithm.rs(+1 -0)📝
crates/proto/src/rr/dnssec/digest_type.rs(+1 -0)📝
crates/proto/src/rr/dnssec/public_key.rs(+1 -0)📝
crates/proto/src/rr/dnssec/rdata/mod.rs(+2 -0)📝
crates/proto/src/rr/rdata/opt.rs(+2 -0)📝
crates/proto/src/rr/record_data.rs(+1 -0)📝
crates/proto/src/rr/record_type.rs(+1 -0)📝
crates/proto/src/serialize/binary/decoder.rs(+1 -0)...and 12 more files
📄 Description
I don't know if we want to make this guarantee. But It's worth putting it up for discussion.
We know that record types will be coming in the future, but adding non_exhaustive to RecordType is also a bit annoying because the RecordTypes are mostly fixed. So The question here is, where do we want to add non_exhaustive such that minor and patch releases are forward compatible. Do we want to make forward compatibility a guarantee on perhaps on patch releases, but not minor releases? See #1425, which happened on a pre 1.0 patch release as an example.
How extreme do we want to be on this at the detriment of losing one of Rusts greatest checks (all enum variants are covered in a match statement).
Fixes: #1425
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.