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

lints: clarify rc_buffer and add caveats #6090

Merged
merged 1 commit into from
Sep 27, 2020

Conversation

Fishrock123
Copy link
Contributor

@Fishrock123 Fishrock123 commented Sep 27, 2020

This didn't display some types properly in the docs due the lack of code formatting.

Also, refs for the caveat:
#6044 (comment)
http-rs/surf#242

Fwiw I can't get cargo test to run, even on nightly. I get:

error[E0463]: can't find crate for `rustc_ast`

Please keep the line below
changelog: none, nightly

This didn't display some types properly in the docs due the lack of code formatting.

Also, refs for the caveat:
rust-lang#6044 (comment)
http-rs/surf#242
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ebroto (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 27, 2020
@Fishrock123
Copy link
Contributor Author

cc @yaahc, since she reviewed the original pr.

@yaahc
Copy link
Member

yaahc commented Sep 27, 2020

looks great,

@bors r+

@bors
Copy link
Contributor

bors commented Sep 27, 2020

📌 Commit 00e641b has been approved by yaahc

@bors
Copy link
Contributor

bors commented Sep 27, 2020

⌛ Testing commit 00e641b with merge 949b834...

@bors
Copy link
Contributor

bors commented Sep 27, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: yaahc
Pushing 949b834 to master...

@bors bors merged commit 949b834 into rust-lang:master Sep 27, 2020
bors added a commit that referenced this pull request Oct 7, 2020
Downgrade rc_buffer to restriction

I think Arc\<Vec\<T\>\> and Arc\<String\> and similar are a totally reasonable data structure, as observed by others in the comments on [#6044](#6044 (comment)) as well. Doing `Arc::make_mut(&mut self.vec).push(...)` or `Arc::make_mut(&mut self.string).push_str("...")` is a terrific and well performing copy-on-write pattern. Linting this with an enabled-by-default <kbd>performance</kbd> lint strikes me as an unacceptable false positive balance.

As of #6090 the documentation of this lint now contains:

> **Known problems:** This pattern can be desirable ...

which should indicate that we shouldn't be linting against correct, reasonable, well-performing patterns with an enabled-by-default lint.

Mentioning #6044, #6090.
r? `@yaahc,` who reviewed the lint.

---

changelog: Remove rc_buffer from default set of enabled lints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants