Skip to content

Commit

Permalink
Preserve indentation within comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Oct 1, 2024
1 parent 9162610 commit 88b235a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ impl<'tcx, 'ctx, 'ctx1> BodyTransCtx<'tcx, 'ctx, 'ctx1> {
// `false`. It will be consumed by the next round of `batching`.
.peeking_take_while(|(_, opt_comment)| opt_comment.is_some())
.map(|(_, opt_comment)| opt_comment.unwrap())
.map(str::trim_start)
.map(|s| s.strip_prefix(" ").unwrap_or(s))
.map(str::to_owned)
.collect_vec();
comments.reverse();
Expand Down
2 changes: 1 addition & 1 deletion charon/tests/ui/comments.out
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn test_crate::sum<'_0>(@1: &'_0 (Slice<u32>)) -> u32
sum@2 := const (0 : u32)
@fake_read(sum@2)
// Comment2
// Comment2.1
// Comment2.1
// Comment2.2
i@3 := const (0 : usize)
@fake_read(i@3)
Expand Down

0 comments on commit 88b235a

Please sign in to comment.