Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc_ng: clean_comment_body does a lot of string copies #9274

Closed
emberian opened this issue Sep 18, 2013 · 1 comment
Closed

rustdoc_ng: clean_comment_body does a lot of string copies #9274

emberian opened this issue Sep 18, 2013 · 1 comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@emberian
Copy link
Member

Rather unideal, see if it can be improved.

From emberian/rustdoc_ng#31

@alexcrichton
Copy link
Member

this is closed by #9374

flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 2, 2023
…entri3

move `read_zero_byte_vec` to nursery

I think the concerns in rust-lang#9274 are valid, and we should move this to nursery while we're reworking this.

changelog: [`read_zero_byte_vec`] moved to nursery
flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 25, 2024
`read_zero_byte_vec` refactor for better heuristics

Fixes rust-lang#9274

Previously, the implementation of `read_zero_byte_vec` only checks for the next statement after the vec init. This fails when there is a block with statements that are expanded and walked by the old visitor.

This PR refactors so that:

1. It checks if there is a `resize`	on the vec
2. It works on blocks properly

e.g. This should properly lint now:

```
    let mut v = Vec::new();
    {
        f.read(&mut v)?;
        //~^ ERROR: reading zero byte data to `Vec`
    }
```

changelog: [`read_zero_byte_vec`] Refactored for better heuristics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants