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

Refactor core::run to remove the ProgRepr struct... #6044

Closed
wants to merge 1 commit into from

Conversation

Dretch
Copy link
Contributor

@Dretch Dretch commented Apr 24, 2013

...which was a legacy from the time when destructors were implemented using resource types.

a legacy from the time when destructors were implemented
using resource types.
bors added a commit that referenced this pull request Apr 24, 2013
...which was a legacy from the time when destructors were implemented using resource types.
@bors bors closed this Apr 24, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 24, 2020
Add `rc_buffer` lint for checking Rc<String> and friends

Fixes rust-lang#2623

This is a bit different from the original PR attempting to implement this type of lint.   Rather than linting against converting into the unwanted types, this PR lints against declaring the unwanted type in a struct or function definition.

I'm reasonably happy with what I have here, although I used the fully qualified type names for the Path and OsString suggestions, and I'm not sure if I should have just used the short versions instead, even if they might not have been declared via use.

Also, I don't know if "buffer type" is the best way to put it or not.  Alternatively I could call it a "growable type" or "growable buffer type", but I was thinking of PathBuf when I started making the lint.

changelog: Add `rc_buffer` lint
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 9, 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 [rust-lang#6044](rust-lang/rust-clippy#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 rust-lang#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 rust-lang#6044, rust-lang#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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants