Skip to content

Commit 2cef436

Browse files
Leon Yang (Containers)facebook-github-bot
Leon Yang (Containers)
authored andcommitted
Fix Queriable for empty enum
Summary: Turns out that reference to empty enum is consider inhabited: rust-lang/rust#80651 Fix by adding a unreachable clause. Differential Revision: D36850027 fbshipit-source-id: cc338becc4ebd57c33441c2d8575b07c3052229e
1 parent bcbb7cb commit 2cef436

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

below/below_derive/src/qenum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub fn enum_to_string_derive_impl(ast: &DeriveInput) -> syn::Result<TokenStream>
7777
fn to_string(&self) -> ::std::string::String {
7878
match self {
7979
#(#variant_to_string_arms)*
80+
_ => unreachable!(),
8081
}
8182
}
8283
}

below/below_derive/src/queriable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ pub fn queriable_derive_impl(ast: &DeriveInput) -> syn::Result<TokenStream> {
266266
fn query(&self, field_id: &Self::FieldId) -> ::std::option::Option<Field> {
267267
match field_id {
268268
#(#queriable_match_arms)*
269+
_ => unreachable!(),
269270
}
270271
}
271272
}

0 commit comments

Comments
 (0)