Skip to content

Commit

Permalink
Specify core::assert for static assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
petekubiak committed Nov 22, 2024
1 parent 1882ffa commit 8275d90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion host-macros/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ impl ServerBuilder {

quote! {
const _ATTRIBUTE_TABLE_SIZE: usize = #attribute_table_size;
// This pattern causes the assertion to happen at compile time
const _: () = {
assert!(_ATTRIBUTE_TABLE_SIZE >= GAP_SERVICE_ATTRIBUTE_COUNT #code_attribute_summation, "Specified attribute table size is insufficient. Please increase attribute_table_size");
core::assert!(_ATTRIBUTE_TABLE_SIZE >= GAP_SERVICE_ATTRIBUTE_COUNT #code_attribute_summation, "Specified attribute table size is insufficient. Please increase attribute_table_size or remove the argument entirely to allow automatic sizing of the attribute table.");
};

#visibility struct #name<'reference, 'values, C: Controller>
Expand Down

0 comments on commit 8275d90

Please sign in to comment.