Skip to content

Commit ac8e98a

Browse files
committed
fix: handle verusdoc fail caused by assert_by_compute_only
1 parent a7679b2 commit ac8e98a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

source/builtin_macros/src/syntax.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,6 +2771,14 @@ impl Visitor {
27712771
return false;
27722772
};
27732773

2774+
if self.rustdoc && self.inside_const {
2775+
let Expr::Assert(assert) = take_expr(expr) else { unreachable!() };
2776+
let span = assert.assert_token.span;
2777+
let attrs = assert.attrs;
2778+
*expr = quote_verbatim!(span, attrs => ());
2779+
return true;
2780+
}
2781+
27742782
self.inside_ghost += 1;
27752783
self.visit_expr_with_arith(expr, InsideArith::None);
27762784
self.inside_ghost -= 1;

0 commit comments

Comments
 (0)