Closed msprotz closed 2 weeks ago
Turns out clippy has a lint that detects // SAFETY
comments before unsafe blocks. They do span shenanigans to recover the comments. Code is here for inspiration.
I made a decent attempt here: https://github.com/AeneasVerif/charon/pull/358, which is made mostly pointless by #233.
Alright, this now works! Comments on each statement are accessible in comments_before
.
The heuristic for where to place comments is quite naive however, so please report back if comments end up in surprising places.
In the following snippet, I would like a way to retrieve the comment in LLBC.
Possible thoughts include:
Thanks!