api-macro: replace unreachable with a panic

(we're not running into this, but ran into an unreachable in
`syn` during development, and I needed to make sure it's not
one of ours...)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-03-06 11:56:42 +01:00
parent dc4ec65723
commit f4e88aab6c

View File

@ -171,7 +171,7 @@ fn handle_regular_struct(
}
}
} else {
unreachable!();
panic!("handle_regular struct without named fields");
};
// now error out about all the fields not found in the struct:
@ -195,7 +195,7 @@ fn handle_regular_struct(
if let api::SchemaItem::Object(ref mut obj) = &mut schema.item {
obj.extend_properties(new_fields);
} else {
unreachable!();
panic!("handle_regular_struct with non-object schema");
}
finish_schema(schema, &stru, &stru.ident)