2021 edition; bump dependencies and clippy::swap_ptr_to_ref#9
Open
jqnatividad wants to merge 2 commits intojan-auer:masterfrom
Open
2021 edition; bump dependencies and clippy::swap_ptr_to_ref#9jqnatividad wants to merge 2 commits intojan-auer:masterfrom
jqnatividad wants to merge 2 commits intojan-auer:masterfrom
Conversation
warning: call to `core::mem::swap` with a parameter derived from a raw pointer
--> src/formatter.rs:145:13
|
145 | mem::swap(self, &mut *placeholder.as_mut_ptr());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use ptr::swap: `core::ptr::swap(self, placeholder.as_mut_ptr())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#swap_ptr_to_ref
= note: `#[warn(clippy::swap_ptr_to_ref)]` on by default
|
Thanks @jqnatividad, I just ran into exactly this problem myself! For anyone else running into this, if you are comfortable relying on someone else's GitHub branch, you can steal the fix from the qsv PR linked above by adding the following to your # https://github.com/jan-auer/dynfmt/pull/9
[patch.crates-io]
dynfmt = { git = "https://github.com/jqnatividad/dynfmt", branch = "2021-clippy_ptr_as_ptr-bumpdeps" } |
pkgw
added a commit
to pkgw/cranko
that referenced
this pull request
Dec 14, 2023
See: jan-auer/dynfmt#9 And: https://github.com/jqnatividad/qsv/pull/1467/files This should go away when a new dynfmt release comes out, or at least migrate to a scheme where we're not relying on someone else's repo and branch. But this should be OK for now.
Author
|
A renamed fork - dynfmt2, is now available. |
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.
In my qsv project, dynfmt using the SimpleCurlyFormat was working correctly in debug mode, but not in release mode!
Out of desperation, I tried modernizing dynfmt by just going to 2021 edition, bumping dependencies, and applying the clippy::swap_ptr_to_ref suggestion and it worked!
As to why, I dunno, but I'm contributing this back just in case other folks have a similar problem.