-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Drop finalizer on newtype structs does not work #6090
Labels
A-codegen
Area: Code generation
Comments
Nominating feature complete. |
This seems to be because the drop flag isn't set for newtype structs meaning the branch which calls the actual destructor in |
accepted for production ready |
bors
added a commit
that referenced
this issue
May 2, 2013
Fixed per #6125. |
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Oct 9, 2020
…ts, r=yaahc lints: clarify rc_buffer and add caveats This didn't display some types properly in the docs due the lack of code formatting. Also, refs for the caveat: rust-lang/rust-clippy#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
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
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
This will leak the ptr. Valgrind will complain.
The text was updated successfully, but these errors were encountered: