rust/compiler/rustc_ast_pretty
bors 982c9c1e81 Auto merge of #125055 - nnethercote:Comment-FIXME, r=compiler-errors
Avoid clone in `Comments::next`

`Comments::next`, in `rustc_ast_pretty`, has this comment:
```
// FIXME: This shouldn't probably clone lmao
```
The obvious thing to try is to return `Option<&Comment>` instead of `Option<Comment>`. But that leads to multiple borrows all over the place, because `Comments` must be borrowed from `PrintState` and then processed by `&mut self` methods within `PrintState`.

This PR instead rearranges things so that comments are consumed as they are used, preserving the `Option<Comment>` return type without requiring any cloning.

r? `@compiler-errors`
2024-05-13 06:30:25 +00:00
..
src Auto merge of #125055 - nnethercote:Comment-FIXME, r=compiler-errors 2024-05-13 06:30:25 +00:00
Cargo.toml bump itertools to 0.12 2024-03-08 12:34:05 +03:00