Skip to content

Commit

Permalink
verusdoc: fix requires/ensures on trait pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhance committed Nov 30, 2024
1 parent dc4494b commit 6d43091
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions source/builtin_macros/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,17 @@ impl Visitor {
}

fn visit_trait_items_prefilter(&mut self, items: &mut Vec<TraitItem>) {
if self.rustdoc {
for trait_item in items.iter_mut() {
match trait_item {
TraitItem::Method(trait_item_method) => {
crate::rustdoc::process_trait_item_method(trait_item_method);
}
_ => {}
}
}
}

if self.erase_ghost.erase_all() {
items.retain(|item| match item {
TraitItem::Method(fun) => match fun.sig.mode {
Expand Down Expand Up @@ -3018,10 +3029,6 @@ impl VisitMut for Visitor {
}

fn visit_trait_item_method_mut(&mut self, method: &mut TraitItemMethod) {
if self.rustdoc {
crate::rustdoc::process_trait_item_method(method);
}

let is_spec_method = method.sig.ident.to_string().starts_with(VERUS_SPEC);
let mut stmts =
self.visit_fn(&mut method.attrs, None, &mut method.sig, method.semi_token, true);
Expand Down

0 comments on commit 6d43091

Please sign in to comment.