From f4e88aab6c7bdc0fd8d250d8ab9f9754740a72cc Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 6 Mar 2020 11:56:42 +0100 Subject: [PATCH] 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 --- proxmox-api-macro/src/api/structs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox-api-macro/src/api/structs.rs b/proxmox-api-macro/src/api/structs.rs index 19fc049e..d9510087 100644 --- a/proxmox-api-macro/src/api/structs.rs +++ b/proxmox-api-macro/src/api/structs.rs @@ -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)