about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-10-07 23:10:34 +0000
committerbors <bors@rust-lang.org>2020-10-07 23:10:34 +0000
commit13a80b34baab0576e07eaa986d68a355cb1637a9 (patch)
tree8b35338ac71b4dc3f563319fc6ec1c63b8ff6e6b /src
parent277191890b60b28790d2d100191d6bc3d8975920 (diff)
parent0e159a55d66f4c3cd56237f28a36f31599442102 (diff)
downloadrust-13a80b34baab0576e07eaa986d68a355cb1637a9.tar.gz
rust-13a80b34baab0576e07eaa986d68a355cb1637a9.zip
Auto merge of #6128 - dtolnay:rc_buffer, r=yaahc
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](https://github.com/rust-lang/rust-clippy/pull/6044#event-3799579830) 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
Diffstat (limited to 'src')
-rw-r--r--src/lintlist/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs
index 0dba5a71c50..cc66b1a2db6 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -1888,7 +1888,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
     },
     Lint {
         name: "rc_buffer",
-        group: "perf",
+        group: "restriction",
         desc: "shared ownership of a buffer type",
         deprecation: None,
         module: "types",