Skip to content

Commit

Permalink
Add requires to rust doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmester0 committed Dec 10, 2024
1 parent 18ac15e commit 9a2f48f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hax-lib/macros/src/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,22 @@ macro_rules! identity_proc_macro_attribute {
}
}

#[proc_macro_attribute]
pub fn requires(attr: TokenStream, item: TokenStream) -> TokenStream {
let item: ItemFn = parse_macro_input!(item);
let phi: syn::Expr = parse_macro_input!(attr);

quote! {
#[doc=concat!("Requires: ",stringify!(#phi))]
#item
}.into()
}

identity_proc_macro_attribute!(
fstar_options,
fstar_verification_status,
include,
exclude,
requires,
ensures,
pv_handwritten,
pv_constructor,
Expand Down

0 comments on commit 9a2f48f

Please sign in to comment.