Refactor core::run to remove the ProgRepr struct...#6044
Closed
Dretch wants to merge 1 commit intorust-lang:incomingfrom
Dretch:run-remove-progrepr
Closed
Refactor core::run to remove the ProgRepr struct...#6044Dretch wants to merge 1 commit intorust-lang:incomingfrom Dretch:run-remove-progrepr
Dretch wants to merge 1 commit intorust-lang:incomingfrom
Dretch:run-remove-progrepr
Conversation
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
...which was a legacy from the time when destructors were implemented using resource types.