This PR does not upgrade rustc. Only changes are applied.
We cannot upgrade to the lastet Rust version yet due to wasm-bindgen
breaking some generated types.
THere's also some elided lifetimes in `**/generated/**`, which requires
modification to ast tools.
# What This PR Does
Adds `CodeBuffer`, a simple wrapper over a `Vec<u8>` with a protective and reduced API for upholding UTF-8 validity guarantees. Closes#6147.
Note that this struct is actually quite small. Most of the added lines are doc comments.
The last part of fixing https://github.com/rolldown/rolldown/pull/2375/files#r1789011257
In the following case, the pure comment was written by `//`
```ts
const Component = // #__PURE__
React.forwardRef((props, ref) => {});
```
The printed code looks like this
```ts
const Component =
// #__PURE__ React.forwardRef((props, ref) => {});
```
As you can see, it is broken because the code also commented, so we need to replace `//` with `/* */`
I am unable to print all comments correctly. Comments have way too much semantic meaning in JavaScript.
This PR reduces the scope to only print jsdoc comments that are attached to statements and class elements, in order to get isolated declarations shipped.